{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\\int x^{2}\\, dx\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAEMAAAAgCAYAAABJqsWHAAAABHNCSVQICAgIfAhkiAAAAvpJREFUaIHtmFtIFGEUx3+WhcUuRJAU3ch6iKiWCnyQNIowCAoqeygiih56KXxTFIIeCqMQwgeDApEuDxFdUIouEFQEkXShwF4isowtrOwiBmptD+cMM47NzO7MjrOx+4fhm5lz+8/5vvNdBgrwhSJgYtQkokYJ0AT0AwPAcfI4KeeAlO1qjJRRRCgF/iAJOAhs1/v3UZKKCtWYo2E6Uh7XgXZgagC/DUAX8APoAzqBpUGIjgd2Ion4lWW/t4C9SAKWAVeBj0jCcxb7kWR8CjlODPgNbAo5jismeMhj2g6EzCOuXL4G9DMP6bwrfoy9khHX9qcf5xngJPAceBTQz0ptn/oxLvaQj8fIOAFUAZVIqQSBkYwnfoy9khH2yGgGdgFrgddZ8LdKW18jwwsXkBq85KF3W/W22t4XIctwCjhmk7UgE/OSDDkVA7XAC2SV6wHqNFYS6A3IyxEdatDmoZdAhng3o7fqzWp/2qbfiuwx1gEzLVcMd0zG/MBnSIm1IUk5o+87AvByxV01aklDt1119+hzoz5fZOxEbd/eG9dhjxjGBx9CetdAlYuPTHi5oksNj6ahOwfpobfAAbW7ifRmNlCuPu85yLtVbt+rZI3XKzVuSFO/CbOHHhJsy26HcWBc4yB/oPLZfnlle5/RZ7nfBwymaZcOqoEvwH0HeRkyIX8Ii9c3RtebG3YgJ9yk2pzyE9ABJerTacmsUPmNMHmNqINtHnobgSHgJTADKa9hYLHfwDZMUi69DvI7CM8jYfGagllnG1z0ViPD7g0wS9/VqN21TIO6wJi/7BNkvYXnlrB4lVqCVDjoJJBSSgILbTJjJarMNLADdqu/IeAs8vvxMbJSvFPZ/LB4lWEmY/k/5IuQfxD9DvL1ahv08GVFLdLTw8hkeRk5j/QAn8PklcBMxgIfxP87uC2tcct92Ef4nIA1GeXI0tSqz3O1HUGGXF7BmCMGgRXIj98UMuHkJToZe3iqiZRRhJgGnAe+I7/hNkdLp4ACCsgx/AWRku+zw1vZfQAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$$\\int x^{2}\\, dx$$"
      ],
      "text/plain": [
       "⌠      \n",
       "⎮  2   \n",
       "⎮ x  dx\n",
       "⌡      "
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sympy import *\n",
    "init_printing()\n",
    "x=Symbol('x')\n",
    "print(latex(Integral(x**2)))\n",
    "Integral(x**2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAbcAAAAXCAYAAACI/AGxAAAABHNCSVQICAgIfAhkiAAACE9JREFUeJztnXusHFUdxz99CC1IbhEUNIWM2odAIhqFANK6QBPFpLU8YpA/dLS2IRVfJIUAMfYfbdXyflSxIbcEU2trICFA00ShgkktrTQpcIvaskUv1wJioUC52LL88ftN7nT3nJ0zu/PY6Z5PcrO75/zmzHfPfs+ex5zZCx6Px+PxHMEEQAMYLFHDfcDLwLElakgiC42fQ+p6QSaKiqGKmtsR4P3uive8Jw8K81VAuY3988B7wDUlnd+FLDU+AIwAH8ygrE64HLgDeAJ4A/ns7084xlXzScAh4HZ9fQLwHT3+n8AB4HXgScSU49PL75oA73cXvOeTNVfB771Gob4KKLexbwT2AZNLOr8LWWo8G6nvGzIoqxO26/n3A0O4NXRXzYs07gJ9fZW+fgn4LbAMuBepywawHhiX+h10R4D3uwve88maq+D3XqNQXwWU19hnIL34PSWc25U8NA4Be4AJGZbpygXAdKSR1XBr6OCm+VHg1VjMhcBcWkesJwMv6rkvc9SdFQHe70n0mudD5DOrdXjuvDxfpN9DuquDXqAQX7lOj78G/B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QeBqydBFkoKcoqqi5KDr1fBX8Dt7zQbkyjlgq56uLkHs/ol+GfgtZe11C649tejxHAt7zHo/H4/F4PB6Px+PxeDwej8fj8fQ37wMOgWU85Iyy3QAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$$\\frac{1}{2} \\log{\\left (\\cos{\\left (x \\right )} - 1 \\right )} - \\frac{1}{2} \\log{\\left (\\cos{\\left (x \\right )} + 1 \\right )} + \\cos{\\left (x \\right )}$$"
      ],
      "text/plain": [
       "log(cos(x) - 1)   log(cos(x) + 1)         \n",
       "─────────────── - ─────────────── + cos(x)\n",
       "       2                 2                "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "integrate((cos(x)**2)/sin(x))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def mpr(ex):\n",
    "    print('LaTeX Form:',latex(ex))\n",
    "    return ex"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAALQAAAAaCAYAAAAe23asAAAABHNCSVQICAgIfAhkiAAABnJJREFUeJztmn+IFVUUxz+7buZqsPZTi4ypTDQs6ZdgpqEGQVBgRaVQKYYEWlokoSU+gnKtFUtL6fdmhSwaBlKWJVirYGlqbLkZra2a+9zWyrLafqy9/jhn3Nl5987M+zG+lZ0vDO/Nuefce+6Z75z7ayBBggTHMRfYBvwGtAHrgOEl9ShBd8NJxZEPgamIg5cBa4FDwBmldCpBt8JJzZHTgGPAzR6ZA2SA2hL448VK4EegX572VyH9mFY0j3omTBzptjgXeeijPTKH0hP6auA/4OEC61kLpJGHEoQByENbqvdnAvep/XdAO/ArsBl5QcoL9CtfLAI2AgfUp5+BncACxOc4YOKIF/7YmXC31pFB4hob6pCA9PLIHEpP6A3AEaCywHpGIn2ZF6I3XfXG6f39et8CvA0sBF5TnzLAGqCsQN/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IgaESIMrQAZx3MhHbnxKaj5MFkz6FfJfc5dBly3N3mN1Dk099h2tY7Pvk47GsCF4+qzk7MROlOaEV8Pd0nj4MjtthVIjwxXW6Cq9f7O/2VXocMG3uR40mA29Xo3QKcdTAT+lqVf0/X1XQvbS8DPOaRX0/nLkeVR94b+AQzoUFO4Uxz9Xz7O1V1Zvrky5CX0LaYmq922+keH+YMpevukotyOg9WtvjK4uJIWOxMSBGwKByBzFPTZE8B3KPQMbl6qXCw70Mv0rJW4AVk4u9uY9WTvWp+Uct+QOagNQjB3X3ovWRjktrM8MgK6e8qZJHiPxY+oD6bcK/W2YFsjaUM1xSLbVyYjWTWjcjesXsc34T4mqbrvnGcHAmKnQ0pLIQejGzb/AJcbjB0DxK25tigCwc7oQHuQua4R5FFz9dIZjYt5MqBh4BvkBOlFuRFqFL7XQab3kj/PtP7QvpbhSwG/dnoGrWxffyUInwOuMliGxeGI7HbhcxfO5DT2m3qr3cUiZMjYbGzIUUO23YnGy5BOrfKUj5Xy68osJ0HMGci98TzwgLr74no0bEbSPZJVF9kqyeDfBdiQh9k12RdAW1XIiPCGkNZI+bRIUE4enTsqhFivqH/a5H5VwZ4n+BPMMciHxbl+4H/MGSYc/K0T5AgCxOQvco0Mof+A9kCm0P2h0wJEiRIkCBBggQJEiRIkCAE/wMDjlrX/cIbtwAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$$\\frac{x^{2}}{2} \\log{\\left (x \\right )} - \\frac{3 x^{2}}{4}$$"
      ],
      "text/plain": [
       " 2             2\n",
       "x ⋅log(x)   3⋅x \n",
       "───────── - ────\n",
       "    2        4  "
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "integrate(integrate(ln(x)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "LaTeX Form: \\mu_{0}^{2}\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAABgAAAAcCAYAAAB75n/uAAAABHNCSVQICAgIfAhkiAAAActJREFUSInt1DtoFFEUxvFf4gORSMBCQgotFFHRiCGIIAoKKS0sNFr6alLYaGMjdhZRkEhsbKwUC7GwshG0EIJPtFFSaCOuGCx84Nu1uGfDONxJNjJCCg8My3znzPe/y/3uZY7XCdzDe7zFDayvE3ATB8J0A66jgaV1QorVhZ/Y1RI6awYsCc93NftO1VU8wrx/YT6C11g13dBRNHEw0+vGL9zK9M7iDdbNtIpLAdiY6e2I3khJH23XHJ7gM+ZnescDsL+gXZDOwE70FJ6unPkifMd4BfxKAFYXtGbFc6o1UFxpX7w/qAAM4AMmClpHxexUFc9Bf/zmAN1YKUWwOZPp3wC2Sqt9OBvzKsCrzNy+CvgwXuBL9LZVgRbEUBO7S729Uv7L8R2SQnEEa6W4fsTyHGBTGDQCdBnncUfa2Eb0r2FLfDOOiyWfCZzOAQ6FwTDOYBKfpFM7gGPxfh+9WIgf2FPyGcPtHGAsAJtzzUz1xvz2kn4Sz4tCa5P7pXv8aZuAVpUj21HWOqWrtQ/PpGuinZqMBfWU9GXSvfQHYA0W43Gb5vBNiuVgSR/E3Vn4TFtDATosxfScFNMVdQFIqXuJr9I/Km/6/5oD9RufRmrPdARnqQAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$$\\mu_{0}^{2}$$"
      ],
      "text/plain": [
       "       2\n",
       "\\mu_{0} "
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mu=Symbol('\\\\mu_{0}')\n",
    "ex1=mu**2\n",
    "mpr(ex1)\n",
    "#print(latex(ex1))\n",
    "#ex1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "LaTeX Form: C_{0}^{2}\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAABkAAAAcCAYAAACUJBTQAAAABHNCSVQICAgIfAhkiAAAAbtJREFUSInt1c+LzWEUx/HXpdTVtSEaFmwoRP4CCs2CspxmKcVmNspOSrLxK5HCQlhJbCxkoWYjUdJkNVPTLCgJ+bGY/JzBtTgPffvO/T53uvNVlE99e/qe55zz7jyd5zz8QzqIx5jEG9zGhrohd7EnJd6IW3iFxXWDimrhO3bBvIzjGhzDiDiC6bQOYwgLM7GLUu73VQ4NHMVXtPEAF3Ec1/Eu2e9nIDfwBPOrHK6mJKPY1GG/iUPJr5NO4SVWVwEOJMCYKDmnZgfbabzG+qqg5fgszr6X9jvXDQAnRBVXegBcEHdkG/oKX6vsOJ4gW3uAtCu+I0WnVjL+kG/NnvTrnixN6yQ+/SnIx7Q2ZXq7Dj0VR7a9i195Sgyl2C9iOmzOBe9PkHGs7bDfwA7cLNgGRcvvwzrRxh+wsgrSwOUEmsYdnMFJMU6ep71rhZhHuFTKMyFmXlY7xah+gSkx5EZTBbuxJPktwDcMlOLP4143yGy1QlS2pWQ/LI78t3KjfrZql/4bZdtcIG/Fw9RXsi8TM6wWyJRo2f6SvR8P55B3hgYTbK9o4bOihVfVCSEu4zPxko6Y2Qj/9RfqJ7O8Z+gNZTHhAAAAAElFTkSuQmCC\n",
      "text/latex": [
       "$$C_{0}^{2}$$"
      ],
      "text/plain": [
       "     2\n",
       "C_{0} "
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "C0=Symbol('C_{0}')\n",
    "ex=C0**2\n",
    "mpr(ex)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "LaTeX Form: \\frac{d}{d x} x\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAACIAAAAhCAYAAAC803lsAAAABHNCSVQICAgIfAhkiAAAAfRJREFUWIXt1jtoFUEUBuAvURQEG0FEMaRIMFa5+KyUgAQVxUYUEQsFW0tB0c5GG4tUkgQknWhlpyiIhYqohSJoIYgK4qvwAb4fazGzsG5ys/fu3XtRyQ8LO/+cPfvPmTNnDv8wDuBh1U67S3xTw93/VkgRBnAFX3Afa/EJmzopYhneYwT92IqnSLCok0Iu40yOO40X7fjZ7Dp8D4aFrcjihzblR71kXYGfuJfjV3VaSIJZmJvhhrCyCSGXop/tOb4LE3HuRJGTJcJJGUWfPxN1oEEhNSGqD4RFpTgZ/Yw16McePMNbXMUxfNRc7ZmIP90Xx0fi+GyTflrGUnzGE+FqSHARczopIsXxKCDBdcybyqgT4XmTed8vVOa6SCp8stiNX0IRTHCqhQWVxhZ8E+6ohULr8B3Lyzos03+sE7bgMRZHbocQlfNlhYybfOdMhxreCdvRl5u7HcWsLyPkFg41aNuPl0LtGZxifjgKuVnkaLr+Yye+ojdjP4JHQg5UhqL+owt3hK2Cg3hlcvhbRiP9x0Yh8w/jA1ZXLaJHWPmaHD+GCznuhtCXbK5SQFpZG+0/NginohuvqxSSYpsQkfkZbihyu+I4PZZ7hVqQj1QlKOo/evEcR6P9oFC6S9WDItTrPxYIlXU0Z38O19ohZAYz+KvxG3s0kRY1eA+WAAAAAElFTkSuQmCC\n",
      "text/latex": [
       "$$\\frac{d}{d x} x$$"
      ],
      "text/plain": [
       "d    \n",
       "──(x)\n",
       "dx   "
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "mpr((Derivative(x)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAF4AAAAhCAYAAABQphx6AAAABHNCSVQICAgIfAhkiAAAA2VJREFUaIHt2UmIXFUUgOGvo7iQBMQBB5Qs0hiRkEaMLjQOtKJBiQsHpMmiEV0oBgkOqBEhChJBg0QhaALSGxGDoCDiiDgjRolBTS8caAWH6CJGcDa2i/OKVL9U97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= 2 x$$"
      ],
      "text/plain": [
       "d ⎛ 2⎞      \n",
       "──⎝x ⎠ = 2⋅x\n",
       "dx          "
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ex=x**2\n",
    "Eq(Derivative(ex),diff(ex))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAS4AAAAaCAYAAAAJ3LFMAAAABHNCSVQICAgIfAhkiAAACTlJREFUeJztnHuwVVUdxz88UvAxYEZok82xELUx8dXDDAWJzJp81TDFNLoZi3FGtHIyR8uRaSLQYCww7IVeHTMZYKzUKHr5AFNQHnOVK07qwUYu16uhEWEhnP74rs3ZZ5+1n2fvc+4d1nfmzL3nt377t9Zev+/+rbV+a+0DDg4ODgcYrgfWAf8C+oEHgJM62iKHIJx/HBws+AMwAz0MHwLuB7YD7+xkoxz2w/nHwSEFDgP2Ap/rdENaQAWoAV2dbQZ3A68ChxZoczD553Tkh8s73RCH3GiVw23jwNGmorMiyseiB2eh+X4k8BU0E/g7sBt4E1iNGju0zMZGoELnA9cZwD7gmoLtJvmnTHwBWAQ8hpauNeCehGvuB3pRwI3DYOAVwM3An4F/mDb9E9gA3ITaXBSuQf07vUCbWVEUh9NyoCUsRY4YFlE+E3XoZPP9CvN9G/BLYC5wB/CGkS8HhpTYXhsqdD5wrUJ9MLJgu0n+KRMbUb/uBHpIF7g+YvRuSNAbDLwC+B/whGnLPBTI15k2vQIcU1A99xibxxdkLw+K4nBaDuTGD1BkHBejsxJ4jfqDcy5atoRHwKOAl1GDP19sMxNRobOBazwaqX5WsN00/kmCh/pmUo5rJwPHoYAxiXSBCxTkthIfbNvFK4/89w8wIkI+x9hdnNNuGD1ogOjUzLJoDidyYBXqwEtC8iHoQa6hkSKMBUAf8MGYykcB/wXuTNnYG0x9i1LqF4UK8YFrGvAoWnrsBrrR7t3BFt0hwNeAzc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oeJIbnj1cBHURyO4kCp6KHcbfKBjqNoHpEOof66xLSI60agXcoHymvagMdINENdbik70Hk1GFAEh+M44FAi5iHn3WX+76K+e/M74n9a5Wz0cmmRPyQ4mHAiWkJVOtsMhxbQKocdBzqEKeicUS/Kce1CW/PX0vxCtoODg4ODg4ODg4ODg4ODg4ODg4ODwwGC/wMkM7Uj8ZuAkAAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$$\\frac{x^{2}}{2} - \\frac{1}{2} \\log{\\left (x^{2} + 1 \\right )} + 3 \\operatorname{atan}{\\left (x \\right )}$$"
      ],
      "text/plain": [
       " 2      ⎛ 2    ⎞            \n",
       "x    log⎝x  + 1⎠            \n",
       "── - ─────────── + 3⋅atan(x)\n",
       "2         2                 "
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "integrate((x**3+3)/(x**2+1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Eq(Derivative((1 + 1/(2*x))**x, x), (1 + 1/(2*x))**x*(log(1 + 1/(2*x)) - 1/(2*x*(1 + 1/(2*x)))))"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sympy import*\n",
    "x=Symbol('x')\n",
    "ex=(1+1/(2*x))**x\n",
    "Eq(Derivative(ex),diff(ex))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAgIAAAAiCAYAAAAtdrHTAAAABHNCSVQICAgIfAhkiAAADKBJREFUeJztnXmwHEUdxz9JMBISDSJUAgo8IXkxFhCQQ5BruRIgFYIIXinlCZjyQEALkETFFCVHAZaAR0k4fKCoSAKEKEioAg+gkOIJFEfwXtGEU7nEoBzPP749tftmZ2Z7dmd2Znd/n6qt97ant/s3s9/t6fn1r7vBMAzDM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2xYlM53G+KRN0JS5UbRvQRS9qiEoXkdla0+2RFrYuy7N5x50MVqqOo4ydATOoxYrE0Wr534oCg716chX4+y7jcae+JWMnR/cyv72+6GeStogJCOZ2UicA8WakQrTQj5kqYUVaIggT85DN/Sr3P/DwN9R43czyVvqmobyoWztybVodkR4F8Rm96BVSFdxlKEjsJbGjaDqafXcd3L1NguS3B4tYd3wG9raFbB7KH052g6znrLsb28YRvYcSv5PpgehduUJ5O58GTV8p5HzkqdGV3AB0kbcDJGke9CtxE+BBb+OwFJ0owxer6In7fq0ZsMncfUMIq9bXEe2nXMPhtZ2aGLbycR4JI5whYcXFxhBy1MGlGV/e8Mw8uN+FHluGJ3mG8jl/Z6Y483uQdegTbXi8OkIbIZuxMFrJXBJKK2Z+z2untPQjI4o2j3391Ebyk/id9R2UxzDAlfAW+rS9ndpH3bv56BozGNRoEHYU2AYRm8wl+QxTMPIg0tIvhH63INOJXnaXdFDA3eiDX/CZHHuJ9C4KmeYvUnY3norNFPgUjR+UB8oOAtFKq5D04FAYxFvUI7oUsMwsucHRE8/M4w8+C4a9z4QBZMGrynuuO89aEcUcV+/8uIU9AS8M7qnner+38bTtmH8OgLN6tkCDTOEn9izOverid80LGAVY2ceNLAI7Sn+HJqTehZyQ7S7v71hGN3HW1HQVThgyTDyIG59hGWkvwfdjVbEDajElD3sadswfh2BZvUc52wLk8W5T0KdiT2JZxE1D79hGIYXM4neE8Awysw84A+UrxO7Cq3AmQcnAmsSjs8EPpVT3YZh9DgWxW90IyfRxAVeAKejGXp5sBgN48dhv2PDMAzDMAzDMAzDMAzDMAzDMAzDMAzDMPg/0UJztkMbQm8AAAAASUVORK5CYII=\n",
      "text/latex": [
       "$$\\frac{d}{d x} \\left(1 + \\frac{1}{2 x}\\right)^{x} = \\left(1 + \\frac{1}{2 x}\\right)^{x} \\left(\\log{\\left (1 + \\frac{1}{2 x} \\right )} - \\frac{1}{2 x \\left(1 + \\frac{1}{2 x}\\right)}\\right)$$"
      ],
      "text/plain": [
       "  ⎛         x⎞            x                               \n",
       "d ⎜⎛     1 ⎞ ⎟   ⎛     1 ⎞  ⎛   ⎛     1 ⎞         1      ⎞\n",
       "──⎜⎜1 + ───⎟ ⎟ = ⎜1 + ───⎟ ⋅⎜log⎜1 + ───⎟ - ─────────────⎟\n",
       "dx⎝⎝    2⋅x⎠ ⎠   ⎝    2⋅x⎠  ⎜   ⎝    2⋅x⎠       ⎛     1 ⎞⎟\n",
       "                            ⎜               2⋅x⋅⎜1 + ───⎟⎟\n",
       "                            ⎝                   ⎝    2⋅x⎠⎠"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ex=(1+1/(2*x))**x\n",
    "Eq(Derivative(ex),diff(ex))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAJoAAAAWCAYAAAA4jYW0AAAABHNCSVQICAgIfAhkiAAABMRJREFUaIHtmn2IFVUYh5/dVdvNyGiLiiKDzHajsu8glMJsjSCKtgL/CEes6ENLKtGMcIlAKcPtA8KCWIPog10yLIolSLKkYknL0mSjbtLHdhOtIJfU2v74vZd79+zM3Pm63k3mgWF23vec9/zO7DtnzjlzISenjhwLPAMUgAPACLDMfC8DRWBywtgXW7yF6SSOe24B/gamVtieBgaBE+uiqHYk7utGlAzvAI8DXUA7cAnwL/BASmFvAr8Ax6SMk5RW4HbT8S0wDPwBfIQegMYM2mgABoAX7foh4FfgzAxijzcS9bUNJdl7Pr5+4HegJaWwy6yNFSnjJOUua/9n4BVgFfAS6tsI0ItuXlo6gIPAcuBP9KAeqcTu6z3oZt/h2Kej0eyFjITtBH4AmjKKF4fZwPWMHblOBnaj/ndm1NYW4BBwbYoYHtJ0VQZ6otBl7YUdfloi9bUzJGgbsNr+vtqnbr/5bnLsDUCP+VY7vpVmnxsmqg6sQLqeDfB3Au8Ce9D8ddDq+D0ws4G/0AN6U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oR/JPYG+j+Xk5OTk5OTk5IzmPzrYd840yHm0AAAAAElFTkSuQmCC\n",
      "text/latex": [
       "$$f{\\left (x \\right )} = 2 e^{x} + e^{- x}$$"
      ],
      "text/plain": [
       "          x    -x\n",
       "f(x) = 2⋅ℯ  + ℯ  "
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "f=Function('f')(x)\n",
    "ex=dsolve(Eq(f.diff(x,x),f),f)\n",
    "ex.subs({'C1':1,'C2':2})"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAM0AAAAYCAYAAABZT3n1AAAABHNCSVQICAgIfAhkiAAABYJJREFUeJztm31oVWUcxz9Xx9hqYaS9Uq2opP2TlhYVNc6stBcqM5fQP13KJBaJiFEZ4YheDPpjKRUVmEWvmr0Swgh6MaNFkiC60qQVzFouKbPWcrr++P1unp3dc8/zPOfce+7G+cA49z7P73n73uft/J5nkJGRkQgvA78CR6dcjxnAMHBHSHwrMAg0+sKeAnYBx5e3alVNpkuFmQkcBpaWIe/5wGpgE7AfGRCvRKR5B/gZaCgSlwO+Bl7Q78uAPuCsEvmdAzwObAH2Agf1+RHQBhxl0I5KMhlYiOjwPTAA/AF8jkwmE4qksdVlrGkCbn2pwInAIWCVfnfReASdwO9AvXH1zdmKNO5PoBuzhl6kdstD4mcjP/L9iHgzQ+xywMPIDDwMbAaeBVYCrwO/afgms6ZUjLuQeu0BXkU69xrkNxoG3kLaFsREl7GqCbj1pQKL1L5Fv7tqDMBUZJV53rYFhrQgs1oO8DBvaDfwIzAxJP4LYAi4ukQeL2p524FpReLrgQfVLmnyWrbnkHYWcD2jZ7uTgJ8035tD0kbpkqYmcXHtSwAbgX6O9Kc4GrNSDa4wLDwOHuYNXaG2c4rEzQL+Qgb7BSHpl2r6HcAxEWWVY4XN4z5oSrFc811dJC5Kl7Q1SRIP8740C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+p7ZrkKqEMuR35QrgIsqEdcj6ZuzSTpYvTF1Z24OQLGI2Np0HRj79q3phnZiqT9T2hNyNJ5RgplL0C2LAu1Hh2Iy7kxhbpUCw3ImdN0ZNAs088ubviMcUobsjceRLwqzanWJn08krvVkJGRkZGRkZGRkZGRkZEC/wFZM/Odk1dVFgAAAABJRU5ErkJggg==\n",
      "text/latex": [
       "$$\\left(-1\\right)^{x} C_{0} + 2^{x} C_{1} - \\frac{1}{2}$$"
      ],
      "text/plain": [
       "    x       x      1\n",
       "(-1) ⋅C₀ + 2 ⋅C₁ - ─\n",
       "                   2"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b=Function('g')\n",
    "rsolve(Eq(b(x+1)-b(x),2*b(x-1)+1),b(x))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "None\n"
     ]
    }
   ],
   "source": [
    "b=Function('g')\n",
    "e=rsolve(Eq(b(x+1),1/(x*b(x))),b(x))\n",
    "print(e)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0 0\n",
      "1 1\n",
      "2 2\n",
      "3 5\n",
      "4 10\n",
      "5 21\n",
      "6 42\n",
      "7 85\n",
      "8 170\n",
      "9 341\n"
     ]
    }
   ],
   "source": [
    "ex1=ex.subs({'C0':-frac(Rational(1,6)),'C1':frac(Rational(2,3))})\n",
    "for i in range(10):\n",
    "    print(i,ex1.subs({'x':i}))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on class frac in module sympy.functions.elementary.integers:\n",
      "\n",
      "class frac(sympy.core.function.Function)\n",
      " |  Represents the fractional part of x\n",
      " |  \n",
      " |  For real numbers it is defined [1]_ as\n",
      " |  \n",
      " |  .. math::\n",
      " |      x - \\lfloor{x}\\rfloor\n",
      " |  \n",
      " |  Examples\n",
      " |  ========\n",
      " |  \n",
      " |  >>> from sympy import Symbol, frac, Rational, floor, ceiling, I\n",
      " |  >>> frac(Rational(4, 3))\n",
      " |  1/3\n",
      " |  >>> frac(-Rational(4, 3))\n",
      " |  2/3\n",
      " |  \n",
      " |  returns zero for integer arguments\n",
      " |  \n",
      " |  >>> n = Symbol('n', integer=True)\n",
      " |  >>> frac(n)\n",
      " |  0\n",
      " |  \n",
      " |  rewrite as floor\n",
      " |  \n",
      " |  >>> x = Symbol('x')\n",
      " |  >>> frac(x).rewrite(floor)\n",
      " |  x - floor(x)\n",
      " |  \n",
      " |  for complex arguments\n",
      " |  \n",
      " |  >>> r = Symbol('r', real=True)\n",
      " |  >>> t = Symbol('t', real=True)\n",
      " |  >>> frac(t + I*r)\n",
      " |  I*frac(r) + frac(t)\n",
      " |  \n",
      " |  See Also\n",
      " |  ========\n",
      " |  \n",
      " |  sympy.functions.elementary.integers.floor\n",
      " |  sympy.functions.elementary.integers.ceiling\n",
      " |  \n",
      " |  References\n",
      " |  ===========\n",
      " |  \n",
      " |  .. [1] http://en.wikipedia.org/wiki/Fractional_part\n",
      " |  .. [2] http://mathworld.wolfram.com/FractionalPart.html\n",
      " |  \n",
      " |  Method resolution order:\n",
      " |      frac\n",
      " |      sympy.core.function.Function\n",
      " |      sympy.core.function.Application\n",
      " |      sympy.core.expr.Expr\n",
      " |      sympy.core.basic.Basic\n",
      " |      sympy.core.evalf.EvalfMixin\n",
      " |      builtins.object\n",
      " |  \n",
      " |  Class methods defined here:\n",
      " |  \n",
      " |  eval(arg) from sympy.core.function.FunctionClass\n",
      " |      Returns a canonical form of cls applied to arguments args.\n",
      " |      \n",
      " |      The eval() method is called when the class cls is about to be\n",
      " |      instantiated and it should return either some simplified instance\n",
      " |      (possible of some other class), or if the class cls should be\n",
      " |      unmodified, return None.\n",
      " |      \n",
      " |      Examples of eval() for the function \"sign\"\n",
      " |      ---------------------------------------------\n",
      " |      \n",
      " |      @classmethod\n",
      " |      def eval(cls, arg):\n",
      " |          if arg is S.NaN:\n",
      " |              return S.NaN\n",
      " |          if arg is S.Zero: return S.Zero\n",
      " |          if arg.is_positive: return S.One\n",
      " |          if arg.is_negative: return S.NegativeOne\n",
      " |          if isinstance(arg, Mul):\n",
      " |              coeff, terms = arg.as_coeff_Mul(rational=True)\n",
      " |              if coeff is not S.One:\n",
      " |                  return cls(coeff) * cls(terms)\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data and other attributes defined here:\n",
      " |  \n",
      " |  default_assumptions = {}\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Methods inherited from sympy.core.function.Function:\n",
      " |  \n",
      " |  as_base_exp(self)\n",
      " |      Returns the method as the 2-tuple (base, exponent).\n",
      " |  \n",
      " |  fdiff(self, argindex=1)\n",
      " |      Returns the first derivative of the function.\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Class methods inherited from sympy.core.function.Function:\n",
      " |  \n",
      " |  class_key() from sympy.core.function.FunctionClass\n",
      " |      Nice order of classes.\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Static methods inherited from sympy.core.function.Function:\n",
      " |  \n",
      " |  __new__(cls, *args, **options)\n",
      " |      Create and return a new object.  See help(type) for accurate signature.\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data descriptors inherited from sympy.core.function.Function:\n",
      " |  \n",
      " |  is_commutative\n",
      " |      Returns whether the functon is commutative.\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data descriptors inherited from sympy.core.function.Application:\n",
      " |  \n",
      " |  __dict__\n",
      " |      dictionary for instance variables (if defined)\n",
      " |  \n",
      " |  __weakref__\n",
      " |      list of weak references to the object (if defined)\n",
      " |  \n",
      " |  func\n",
      " |      The top-level function in an expression.\n",
      " |      \n",
      " |      The following should hold for all objects::\n",
      " |      \n",
      " |          >> x == x.func(*x.args)\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> a = 2*x\n",
      " |      >>> a.func\n",
      " |      <class 'sympy.core.mul.Mul'>\n",
      " |      >>> a.args\n",
      " |      (2, x)\n",
      " |      >>> a.func(*a.args)\n",
      " |      2*x\n",
      " |      >>> a == a.func(*a.args)\n",
      " |      True\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data and other attributes inherited from sympy.core.function.Application:\n",
      " |  \n",
      " |  is_Function = True\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Methods inherited from sympy.core.expr.Expr:\n",
      " |  \n",
      " |  __abs__(self)\n",
      " |  \n",
      " |  __add__(self, other)\n",
      " |  \n",
      " |  __complex__(self)\n",
      " |  \n",
      " |  __div__(self, other)\n",
      " |  \n",
      " |  __float__(self)\n",
      " |  \n",
      " |  __floordiv__(self, other)\n",
      " |  \n",
      " |  __ge__(self, other)\n",
      " |      Return self>=value.\n",
      " |  \n",
      " |  __gt__(self, other)\n",
      " |      Return self>value.\n",
      " |  \n",
      " |  __int__(self)\n",
      " |  \n",
      " |  __le__(self, other)\n",
      " |      Return self<=value.\n",
      " |  \n",
      " |  __long__ = __int__(self)\n",
      " |  \n",
      " |  __lt__(self, other)\n",
      " |      Return self<value.\n",
      " |  \n",
      " |  __mod__(self, other)\n",
      " |  \n",
      " |  __mul__(self, other)\n",
      " |  \n",
      " |  __neg__(self)\n",
      " |  \n",
      " |  __pos__(self)\n",
      " |  \n",
      " |  __pow__(self, other)\n",
      " |  \n",
      " |  __radd__(self, other)\n",
      " |  \n",
      " |  __rdiv__(self, other)\n",
      " |  \n",
      " |  __rfloordiv__(self, other)\n",
      " |  \n",
      " |  __rmod__(self, other)\n",
      " |  \n",
      " |  __rmul__(self, other)\n",
      " |  \n",
      " |  __rpow__(self, other)\n",
      " |  \n",
      " |  __rsub__(self, other)\n",
      " |  \n",
      " |  __rtruediv__ = __rdiv__(self, other)\n",
      " |  \n",
      " |  __sub__(self, other)\n",
      " |  \n",
      " |  __truediv__ = __div__(self, other)\n",
      " |  \n",
      " |  adjoint(self)\n",
      " |  \n",
      " |  apart(self, x=None, **args)\n",
      " |      See the apart function in sympy.polys\n",
      " |  \n",
      " |  args_cnc(self, cset=False, warn=True, split_1=True)\n",
      " |      Return [commutative factors, non-commutative factors] of self.\n",
      " |      \n",
      " |      self is treated as a Mul and the ordering of the factors is maintained.\n",
      " |      If ``cset`` is True the commutative factors will be returned in a set.\n",
      " |      If there were repeated factors (as may happen with an unevaluated Mul)\n",
      " |      then an error will be raised unless it is explicitly supressed by\n",
      " |      setting ``warn`` to False.\n",
      " |      \n",
      " |      Note: -1 is always separated from a Number unless split_1 is False.\n",
      " |      \n",
      " |      >>> from sympy import symbols, oo\n",
      " |      >>> A, B = symbols('A B', commutative=0)\n",
      " |      >>> x, y = symbols('x y')\n",
      " |      >>> (-2*x*y).args_cnc()\n",
      " |      [[-1, 2, x, y], []]\n",
      " |      >>> (-2.5*x).args_cnc()\n",
      " |      [[-1, 2.5, x], []]\n",
      " |      >>> (-2*x*A*B*y).args_cnc()\n",
      " |      [[-1, 2, x, y], [A, B]]\n",
      " |      >>> (-2*x*A*B*y).args_cnc(split_1=False)\n",
      " |      [[-2, x, y], [A, B]]\n",
      " |      >>> (-2*x*y).args_cnc(cset=True)\n",
      " |      [{-1, 2, x, y}, []]\n",
      " |      \n",
      " |      The arg is always treated as a Mul:\n",
      " |      \n",
      " |      >>> (-2 + x + A).args_cnc()\n",
      " |      [[], [x - 2 + A]]\n",
      " |      >>> (-oo).args_cnc() # -oo is a singleton\n",
      " |      [[-1, oo], []]\n",
      " |  \n",
      " |  as_coeff_Add(self, rational=False)\n",
      " |      Efficiently extract the coefficient of a summation.\n",
      " |  \n",
      " |  as_coeff_Mul(self, rational=False)\n",
      " |      Efficiently extract the coefficient of a product.\n",
      " |  \n",
      " |  as_coeff_add(self, *deps)\n",
      " |      Return the tuple (c, args) where self is written as an Add, ``a``.\n",
      " |      \n",
      " |      c should be a Rational added to any terms of the Add that are\n",
      " |      independent of deps.\n",
      " |      \n",
      " |      args should be a tuple of all other terms of ``a``; args is empty\n",
      " |      if self is a Number or if self is independent of deps (when given).\n",
      " |      \n",
      " |      This should be used when you don't know if self is an Add or not but\n",
      " |      you want to treat self as an Add or if you want to process the\n",
      " |      individual arguments of the tail of self as an Add.\n",
      " |      \n",
      " |      - if you know self is an Add and want only the head, use self.args[0];\n",
      " |      - if you don't want to process the arguments of the tail but need the\n",
      " |        tail then use self.as_two_terms() which gives the head and tail.\n",
      " |      - if you want to split self into an independent and dependent parts\n",
      " |        use ``self.as_independent(*deps)``\n",
      " |      \n",
      " |      >>> from sympy import S\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> (S(3)).as_coeff_add()\n",
      " |      (3, ())\n",
      " |      >>> (3 + x).as_coeff_add()\n",
      " |      (3, (x,))\n",
      " |      >>> (3 + x + y).as_coeff_add(x)\n",
      " |      (y + 3, (x,))\n",
      " |      >>> (3 + y).as_coeff_add(x)\n",
      " |      (y + 3, ())\n",
      " |  \n",
      " |  as_coeff_exponent(self, x)\n",
      " |      ``c*x**e -> c,e`` where x can be any symbolic expression.\n",
      " |  \n",
      " |  as_coeff_mul(self, *deps, **kwargs)\n",
      " |      Return the tuple (c, args) where self is written as a Mul, ``m``.\n",
      " |      \n",
      " |      c should be a Rational multiplied by any factors of the Mul that are\n",
      " |      independent of deps.\n",
      " |      \n",
      " |      args should be a tuple of all other factors of m; args is empty\n",
      " |      if self is a Number or if self is independent of deps (when given).\n",
      " |      \n",
      " |      This should be used when you don't know if self is a Mul or not but\n",
      " |      you want to treat self as a Mul or if you want to process the\n",
      " |      individual arguments of the tail of self as a Mul.\n",
      " |      \n",
      " |      - if you know self is a Mul and want only the head, use self.args[0];\n",
      " |      - if you don't want to process the arguments of the tail but need the\n",
      " |        tail then use self.as_two_terms() which gives the head and tail;\n",
      " |      - if you want to split self into an independent and dependent parts\n",
      " |        use ``self.as_independent(*deps)``\n",
      " |      \n",
      " |      >>> from sympy import S\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> (S(3)).as_coeff_mul()\n",
      " |      (3, ())\n",
      " |      >>> (3*x*y).as_coeff_mul()\n",
      " |      (3, (x, y))\n",
      " |      >>> (3*x*y).as_coeff_mul(x)\n",
      " |      (3*y, (x,))\n",
      " |      >>> (3*y).as_coeff_mul(x)\n",
      " |      (3*y, ())\n",
      " |  \n",
      " |  as_coefficient(self, expr)\n",
      " |      Extracts symbolic coefficient at the given expression. In\n",
      " |      other words, this functions separates 'self' into the product\n",
      " |      of 'expr' and 'expr'-free coefficient. If such separation\n",
      " |      is not possible it will return None.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import E, pi, sin, I, Poly\n",
      " |      >>> from sympy.abc import x\n",
      " |      \n",
      " |      >>> E.as_coefficient(E)\n",
      " |      1\n",
      " |      >>> (2*E).as_coefficient(E)\n",
      " |      2\n",
      " |      >>> (2*sin(E)*E).as_coefficient(E)\n",
      " |      \n",
      " |      Two terms have E in them so a sum is returned. (If one were\n",
      " |      desiring the coefficient of the term exactly matching E then\n",
      " |      the constant from the returned expression could be selected.\n",
      " |      Or, for greater precision, a method of Poly can be used to\n",
      " |      indicate the desired term from which the coefficient is\n",
      " |      desired.)\n",
      " |      \n",
      " |      >>> (2*E + x*E).as_coefficient(E)\n",
      " |      x + 2\n",
      " |      >>> _.args[0]  # just want the exact match\n",
      " |      2\n",
      " |      >>> p = Poly(2*E + x*E); p\n",
      " |      Poly(x*E + 2*E, x, E, domain='ZZ')\n",
      " |      >>> p.coeff_monomial(E)\n",
      " |      2\n",
      " |      >>> p.nth(0, 1)\n",
      " |      2\n",
      " |      \n",
      " |      Since the following cannot be written as a product containing\n",
      " |      E as a factor, None is returned. (If the coefficient ``2*x`` is\n",
      " |      desired then the ``coeff`` method should be used.)\n",
      " |      \n",
      " |      >>> (2*E*x + x).as_coefficient(E)\n",
      " |      >>> (2*E*x + x).coeff(E)\n",
      " |      2*x\n",
      " |      \n",
      " |      >>> (E*(x + 1) + x).as_coefficient(E)\n",
      " |      \n",
      " |      >>> (2*pi*I).as_coefficient(pi*I)\n",
      " |      2\n",
      " |      >>> (2*I).as_coefficient(pi*I)\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      \n",
      " |      coeff: return sum of terms have a given factor\n",
      " |      as_coeff_Add: separate the additive constant from an expression\n",
      " |      as_coeff_Mul: separate the multiplicative constant from an expression\n",
      " |      as_independent: separate x-dependent terms/factors from others\n",
      " |      sympy.polys.polytools.coeff_monomial: efficiently find the single coefficient of a monomial in Poly\n",
      " |      sympy.polys.polytools.nth: like coeff_monomial but powers of monomial terms are used\n",
      " |  \n",
      " |  as_coefficients_dict(self)\n",
      " |      Return a dictionary mapping terms to their Rational coefficient.\n",
      " |      Since the dictionary is a defaultdict, inquiries about terms which\n",
      " |      were not present will return a coefficient of 0. If an expression is\n",
      " |      not an Add it is considered to have a single term.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import a, x\n",
      " |      >>> (3*x + a*x + 4).as_coefficients_dict()\n",
      " |      {1: 4, x: 3, a*x: 1}\n",
      " |      >>> _[a]\n",
      " |      0\n",
      " |      >>> (3*a*x).as_coefficients_dict()\n",
      " |      {a*x: 3}\n",
      " |  \n",
      " |  as_content_primitive(self, radical=False, clear=True)\n",
      " |      This method should recursively remove a Rational from all arguments\n",
      " |      and return that (content) and the new self (primitive). The content\n",
      " |      should always be positive and ``Mul(*foo.as_content_primitive()) == foo``.\n",
      " |      The primitive need no be in canonical form and should try to preserve\n",
      " |      the underlying structure if possible (i.e. expand_mul should not be\n",
      " |      applied to self).\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import sqrt\n",
      " |      >>> from sympy.abc import x, y, z\n",
      " |      \n",
      " |      >>> eq = 2 + 2*x + 2*y*(3 + 3*y)\n",
      " |      \n",
      " |      The as_content_primitive function is recursive and retains structure:\n",
      " |      \n",
      " |      >>> eq.as_content_primitive()\n",
      " |      (2, x + 3*y*(y + 1) + 1)\n",
      " |      \n",
      " |      Integer powers will have Rationals extracted from the base:\n",
      " |      \n",
      " |      >>> ((2 + 6*x)**2).as_content_primitive()\n",
      " |      (4, (3*x + 1)**2)\n",
      " |      >>> ((2 + 6*x)**(2*y)).as_content_primitive()\n",
      " |      (1, (2*(3*x + 1))**(2*y))\n",
      " |      \n",
      " |      Terms may end up joining once their as_content_primitives are added:\n",
      " |      \n",
      " |      >>> ((5*(x*(1 + y)) + 2*x*(3 + 3*y))).as_content_primitive()\n",
      " |      (11, x*(y + 1))\n",
      " |      >>> ((3*(x*(1 + y)) + 2*x*(3 + 3*y))).as_content_primitive()\n",
      " |      (9, x*(y + 1))\n",
      " |      >>> ((3*(z*(1 + y)) + 2.0*x*(3 + 3*y))).as_content_primitive()\n",
      " |      (1, 6.0*x*(y + 1) + 3*z*(y + 1))\n",
      " |      >>> ((5*(x*(1 + y)) + 2*x*(3 + 3*y))**2).as_content_primitive()\n",
      " |      (121, x**2*(y + 1)**2)\n",
      " |      >>> ((5*(x*(1 + y)) + 2.0*x*(3 + 3*y))**2).as_content_primitive()\n",
      " |      (1, 121.0*x**2*(y + 1)**2)\n",
      " |      \n",
      " |      Radical content can also be factored out of the primitive:\n",
      " |      \n",
      " |      >>> (2*sqrt(2) + 4*sqrt(10)).as_content_primitive(radical=True)\n",
      " |      (2, sqrt(2)*(1 + 2*sqrt(5)))\n",
      " |      \n",
      " |      If clear=False (default is True) then content will not be removed\n",
      " |      from an Add if it can be distributed to leave one or more\n",
      " |      terms with integer coefficients.\n",
      " |      \n",
      " |      >>> (x/2 + y).as_content_primitive()\n",
      " |      (1/2, x + 2*y)\n",
      " |      >>> (x/2 + y).as_content_primitive(clear=False)\n",
      " |      (1, x/2 + y)\n",
      " |  \n",
      " |  as_expr(self, *gens)\n",
      " |      Convert a polynomial to a SymPy expression.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import sin\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      \n",
      " |      >>> f = (x**2 + x*y).as_poly(x, y)\n",
      " |      >>> f.as_expr()\n",
      " |      x**2 + x*y\n",
      " |      \n",
      " |      >>> sin(x).as_expr()\n",
      " |      sin(x)\n",
      " |  \n",
      " |  as_independent(self, *deps, **hint)\n",
      " |      A mostly naive separation of a Mul or Add into arguments that are not\n",
      " |      are dependent on deps. To obtain as complete a separation of variables\n",
      " |      as possible, use a separation method first, e.g.:\n",
      " |      \n",
      " |      * separatevars() to change Mul, Add and Pow (including exp) into Mul\n",
      " |      * .expand(mul=True) to change Add or Mul into Add\n",
      " |      * .expand(log=True) to change log expr into an Add\n",
      " |      \n",
      " |      The only non-naive thing that is done here is to respect noncommutative\n",
      " |      ordering of variables and to always return (0, 0) for `self` of zero\n",
      " |      regardless of hints.\n",
      " |      \n",
      " |      For nonzero `self`, the returned tuple (i, d) has the\n",
      " |      following interpretation:\n",
      " |      \n",
      " |      * i will has no variable that appears in deps\n",
      " |      * d will be 1 or else have terms that contain variables that are in deps\n",
      " |      * if self is an Add then self = i + d\n",
      " |      * if self is a Mul then self = i*d\n",
      " |      * otherwise (self, S.One) or (S.One, self) is returned.\n",
      " |      \n",
      " |      To force the expression to be treated as an Add, use the hint as_Add=True\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      -- self is an Add\n",
      " |      \n",
      " |      >>> from sympy import sin, cos, exp\n",
      " |      >>> from sympy.abc import x, y, z\n",
      " |      \n",
      " |      >>> (x + x*y).as_independent(x)\n",
      " |      (0, x*y + x)\n",
      " |      >>> (x + x*y).as_independent(y)\n",
      " |      (x, x*y)\n",
      " |      >>> (2*x*sin(x) + y + x + z).as_independent(x)\n",
      " |      (y + z, 2*x*sin(x) + x)\n",
      " |      >>> (2*x*sin(x) + y + x + z).as_independent(x, y)\n",
      " |      (z, 2*x*sin(x) + x + y)\n",
      " |      \n",
      " |      -- self is a Mul\n",
      " |      \n",
      " |      >>> (x*sin(x)*cos(y)).as_independent(x)\n",
      " |      (cos(y), x*sin(x))\n",
      " |      \n",
      " |      non-commutative terms cannot always be separated out when self is a Mul\n",
      " |      \n",
      " |      >>> from sympy import symbols\n",
      " |      >>> n1, n2, n3 = symbols('n1 n2 n3', commutative=False)\n",
      " |      >>> (n1 + n1*n2).as_independent(n2)\n",
      " |      (n1, n1*n2)\n",
      " |      >>> (n2*n1 + n1*n2).as_independent(n2)\n",
      " |      (0, n1*n2 + n2*n1)\n",
      " |      >>> (n1*n2*n3).as_independent(n1)\n",
      " |      (1, n1*n2*n3)\n",
      " |      >>> (n1*n2*n3).as_independent(n2)\n",
      " |      (n1, n2*n3)\n",
      " |      >>> ((x-n1)*(x-y)).as_independent(x)\n",
      " |      (1, (x - y)*(x - n1))\n",
      " |      \n",
      " |      -- self is anything else:\n",
      " |      \n",
      " |      >>> (sin(x)).as_independent(x)\n",
      " |      (1, sin(x))\n",
      " |      >>> (sin(x)).as_independent(y)\n",
      " |      (sin(x), 1)\n",
      " |      >>> exp(x+y).as_independent(x)\n",
      " |      (1, exp(x + y))\n",
      " |      \n",
      " |      -- force self to be treated as an Add:\n",
      " |      \n",
      " |      >>> (3*x).as_independent(x, as_Add=True)\n",
      " |      (0, 3*x)\n",
      " |      \n",
      " |      -- force self to be treated as a Mul:\n",
      " |      \n",
      " |      >>> (3+x).as_independent(x, as_Add=False)\n",
      " |      (1, x + 3)\n",
      " |      >>> (-3+x).as_independent(x, as_Add=False)\n",
      " |      (1, x - 3)\n",
      " |      \n",
      " |      Note how the below differs from the above in making the\n",
      " |      constant on the dep term positive.\n",
      " |      \n",
      " |      >>> (y*(-3+x)).as_independent(x)\n",
      " |      (y, x - 3)\n",
      " |      \n",
      " |      -- use .as_independent() for true independence testing instead\n",
      " |         of .has(). The former considers only symbols in the free\n",
      " |         symbols while the latter considers all symbols\n",
      " |      \n",
      " |      >>> from sympy import Integral\n",
      " |      >>> I = Integral(x, (x, 1, 2))\n",
      " |      >>> I.has(x)\n",
      " |      True\n",
      " |      >>> x in I.free_symbols\n",
      " |      False\n",
      " |      >>> I.as_independent(x) == (I, 1)\n",
      " |      True\n",
      " |      >>> (I + x).as_independent(x) == (I, x)\n",
      " |      True\n",
      " |      \n",
      " |      Note: when trying to get independent terms, a separation method\n",
      " |      might need to be used first. In this case, it is important to keep\n",
      " |      track of what you send to this routine so you know how to interpret\n",
      " |      the returned values\n",
      " |      \n",
      " |      >>> from sympy import separatevars, log\n",
      " |      >>> separatevars(exp(x+y)).as_independent(x)\n",
      " |      (exp(y), exp(x))\n",
      " |      >>> (x + x*y).as_independent(y)\n",
      " |      (x, x*y)\n",
      " |      >>> separatevars(x + x*y).as_independent(y)\n",
      " |      (x, y + 1)\n",
      " |      >>> (x*(1 + y)).as_independent(y)\n",
      " |      (x, y + 1)\n",
      " |      >>> (x*(1 + y)).expand(mul=True).as_independent(y)\n",
      " |      (x, x*y)\n",
      " |      >>> a, b=symbols('a b', positive=True)\n",
      " |      >>> (log(a*b).expand(log=True)).as_independent(b)\n",
      " |      (log(a), log(b))\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      .separatevars(), .expand(log=True), Add.as_two_terms(),\n",
      " |      Mul.as_two_terms(), .as_coeff_add(), .as_coeff_mul()\n",
      " |  \n",
      " |  as_leading_term(self, *symbols)\n",
      " |      Returns the leading (nonzero) term of the series expansion of self.\n",
      " |      \n",
      " |      The _eval_as_leading_term routines are used to do this, and they must\n",
      " |      always return a non-zero value.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> (1 + x + x**2).as_leading_term(x)\n",
      " |      1\n",
      " |      >>> (1/x**2 + x + x**2).as_leading_term(x)\n",
      " |      x**(-2)\n",
      " |  \n",
      " |  as_numer_denom(self)\n",
      " |      expression -> a/b -> a, b\n",
      " |      \n",
      " |      This is just a stub that should be defined by\n",
      " |      an object's class methods to get anything else.\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      normal: return a/b instead of a, b\n",
      " |  \n",
      " |  as_ordered_factors(self, order=None)\n",
      " |      Return list of ordered factors (if Mul) else [self].\n",
      " |  \n",
      " |  as_ordered_terms(self, order=None, data=False)\n",
      " |      Transform an expression to an ordered list of terms.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import sin, cos\n",
      " |      >>> from sympy.abc import x\n",
      " |      \n",
      " |      >>> (sin(x)**2*cos(x) + sin(x)**2 + 1).as_ordered_terms()\n",
      " |      [sin(x)**2*cos(x), sin(x)**2, 1]\n",
      " |  \n",
      " |  as_powers_dict(self)\n",
      " |      Return self as a dictionary of factors with each factor being\n",
      " |      treated as a power. The keys are the bases of the factors and the\n",
      " |      values, the corresponding exponents. The resulting dictionary should\n",
      " |      be used with caution if the expression is a Mul and contains non-\n",
      " |      commutative factors since the order that they appeared will be lost in\n",
      " |      the dictionary.\n",
      " |  \n",
      " |  as_real_imag(self, deep=True, **hints)\n",
      " |      Performs complex expansion on 'self' and returns a tuple\n",
      " |      containing collected both real and imaginary parts. This\n",
      " |      method can't be confused with re() and im() functions,\n",
      " |      which does not perform complex expansion at evaluation.\n",
      " |      \n",
      " |      However it is possible to expand both re() and im()\n",
      " |      functions and get exactly the same results as with\n",
      " |      a single call to this function.\n",
      " |      \n",
      " |      >>> from sympy import symbols, I\n",
      " |      \n",
      " |      >>> x, y = symbols('x,y', real=True)\n",
      " |      \n",
      " |      >>> (x + y*I).as_real_imag()\n",
      " |      (x, y)\n",
      " |      \n",
      " |      >>> from sympy.abc import z, w\n",
      " |      \n",
      " |      >>> (z + w*I).as_real_imag()\n",
      " |      (re(z) - im(w), re(w) + im(z))\n",
      " |  \n",
      " |  as_terms(self)\n",
      " |      Transform an expression to a list of terms.\n",
      " |  \n",
      " |  cancel(self, *gens, **args)\n",
      " |      See the cancel function in sympy.polys\n",
      " |  \n",
      " |  coeff(self, x, n=1, right=False)\n",
      " |      Returns the coefficient from the term(s) containing ``x**n``. If ``n``\n",
      " |      is zero then all terms independent of ``x`` will be returned.\n",
      " |      \n",
      " |      When ``x`` is noncommutative, the coefficient to the left (default) or\n",
      " |      right of ``x`` can be returned. The keyword 'right' is ignored when\n",
      " |      ``x`` is commutative.\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      \n",
      " |      as_coefficient: separate the expression into a coefficient and factor\n",
      " |      as_coeff_Add: separate the additive constant from an expression\n",
      " |      as_coeff_Mul: separate the multiplicative constant from an expression\n",
      " |      as_independent: separate x-dependent terms/factors from others\n",
      " |      sympy.polys.polytools.coeff_monomial: efficiently find the single coefficient of a monomial in Poly\n",
      " |      sympy.polys.polytools.nth: like coeff_monomial but powers of monomial terms are used\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import symbols\n",
      " |      >>> from sympy.abc import x, y, z\n",
      " |      \n",
      " |      You can select terms that have an explicit negative in front of them:\n",
      " |      \n",
      " |      >>> (-x + 2*y).coeff(-1)\n",
      " |      x\n",
      " |      >>> (x - 2*y).coeff(-1)\n",
      " |      2*y\n",
      " |      \n",
      " |      You can select terms with no Rational coefficient:\n",
      " |      \n",
      " |      >>> (x + 2*y).coeff(1)\n",
      " |      x\n",
      " |      >>> (3 + 2*x + 4*x**2).coeff(1)\n",
      " |      0\n",
      " |      \n",
      " |      You can select terms independent of x by making n=0; in this case\n",
      " |      expr.as_independent(x)[0] is returned (and 0 will be returned instead\n",
      " |      of None):\n",
      " |      \n",
      " |      >>> (3 + 2*x + 4*x**2).coeff(x, 0)\n",
      " |      3\n",
      " |      >>> eq = ((x + 1)**3).expand() + 1\n",
      " |      >>> eq\n",
      " |      x**3 + 3*x**2 + 3*x + 2\n",
      " |      >>> [eq.coeff(x, i) for i in reversed(range(4))]\n",
      " |      [1, 3, 3, 2]\n",
      " |      >>> eq -= 2\n",
      " |      >>> [eq.coeff(x, i) for i in reversed(range(4))]\n",
      " |      [1, 3, 3, 0]\n",
      " |      \n",
      " |      You can select terms that have a numerical term in front of them:\n",
      " |      \n",
      " |      >>> (-x - 2*y).coeff(2)\n",
      " |      -y\n",
      " |      >>> from sympy import sqrt\n",
      " |      >>> (x + sqrt(2)*x).coeff(sqrt(2))\n",
      " |      x\n",
      " |      \n",
      " |      The matching is exact:\n",
      " |      \n",
      " |      >>> (3 + 2*x + 4*x**2).coeff(x)\n",
      " |      2\n",
      " |      >>> (3 + 2*x + 4*x**2).coeff(x**2)\n",
      " |      4\n",
      " |      >>> (3 + 2*x + 4*x**2).coeff(x**3)\n",
      " |      0\n",
      " |      >>> (z*(x + y)**2).coeff((x + y)**2)\n",
      " |      z\n",
      " |      >>> (z*(x + y)**2).coeff(x + y)\n",
      " |      0\n",
      " |      \n",
      " |      In addition, no factoring is done, so 1 + z*(1 + y) is not obtained\n",
      " |      from the following:\n",
      " |      \n",
      " |      >>> (x + z*(x + x*y)).coeff(x)\n",
      " |      1\n",
      " |      \n",
      " |      If such factoring is desired, factor_terms can be used first:\n",
      " |      \n",
      " |      >>> from sympy import factor_terms\n",
      " |      >>> factor_terms(x + z*(x + x*y)).coeff(x)\n",
      " |      z*(y + 1) + 1\n",
      " |      \n",
      " |      >>> n, m, o = symbols('n m o', commutative=False)\n",
      " |      >>> n.coeff(n)\n",
      " |      1\n",
      " |      >>> (3*n).coeff(n)\n",
      " |      3\n",
      " |      >>> (n*m + m*n*m).coeff(n) # = (1 + m)*n*m\n",
      " |      1 + m\n",
      " |      >>> (n*m + m*n*m).coeff(n, right=True) # = (1 + m)*n*m\n",
      " |      m\n",
      " |      \n",
      " |      If there is more than one possible coefficient 0 is returned:\n",
      " |      \n",
      " |      >>> (n*m + m*n).coeff(n)\n",
      " |      0\n",
      " |      \n",
      " |      If there is only one possible coefficient, it is returned:\n",
      " |      \n",
      " |      >>> (n*m + x*m*n).coeff(m*n)\n",
      " |      x\n",
      " |      >>> (n*m + x*m*n).coeff(m*n, right=1)\n",
      " |      1\n",
      " |  \n",
      " |  collect(self, syms, func=None, evaluate=True, exact=False, distribute_order_term=True)\n",
      " |      See the collect function in sympy.simplify\n",
      " |  \n",
      " |  combsimp(self)\n",
      " |      See the combsimp function in sympy.simplify\n",
      " |  \n",
      " |  compute_leading_term(self, x, logx=None)\n",
      " |      as_leading_term is only allowed for results of .series()\n",
      " |      This is a wrapper to compute a series first.\n",
      " |  \n",
      " |  conjugate(self)\n",
      " |  \n",
      " |  could_extract_minus_sign(self)\n",
      " |      Canonical way to choose an element in the set {e, -e} where\n",
      " |      e is any expression. If the canonical element is e, we have\n",
      " |      e.could_extract_minus_sign() == True, else\n",
      " |      e.could_extract_minus_sign() == False.\n",
      " |      \n",
      " |      For any expression, the set ``{e.could_extract_minus_sign(),\n",
      " |      (-e).could_extract_minus_sign()}`` must be ``{True, False}``.\n",
      " |      \n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> (x-y).could_extract_minus_sign() != (y-x).could_extract_minus_sign()\n",
      " |      True\n",
      " |  \n",
      " |  count_ops(self, visual=None)\n",
      " |      wrapper for count_ops that returns the operation count.\n",
      " |  \n",
      " |  diff(self, *symbols, **assumptions)\n",
      " |  \n",
      " |  equals(self, other, failing_expression=False)\n",
      " |      Return True if self == other, False if it doesn't, or None. If\n",
      " |      failing_expression is True then the expression which did not simplify\n",
      " |      to a 0 will be returned instead of None.\n",
      " |      \n",
      " |      If ``self`` is a Number (or complex number) that is not zero, then\n",
      " |      the result is False.\n",
      " |      \n",
      " |      If ``self`` is a number and has not evaluated to zero, evalf will be\n",
      " |      used to test whether the expression evaluates to zero. If it does so\n",
      " |      and the result has significance (i.e. the precision is either -1, for\n",
      " |      a Rational result, or is greater than 1) then the evalf value will be\n",
      " |      used to return True or False.\n",
      " |  \n",
      " |  expand(self, deep=True, modulus=None, power_base=True, power_exp=True, mul=True, log=True, multinomial=True, basic=True, **hints)\n",
      " |      Expand an expression using hints.\n",
      " |      \n",
      " |      See the docstring of the expand() function in sympy.core.function for\n",
      " |      more information.\n",
      " |  \n",
      " |  extract_additively(self, c)\n",
      " |      Return self - c if it's possible to subtract c from self and\n",
      " |      make all matching coefficients move towards zero, else return None.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> e = 2*x + 3\n",
      " |      >>> e.extract_additively(x + 1)\n",
      " |      x + 2\n",
      " |      >>> e.extract_additively(3*x)\n",
      " |      >>> e.extract_additively(4)\n",
      " |      >>> (y*(x + 1)).extract_additively(x + 1)\n",
      " |      >>> ((x + 1)*(x + 2*y + 1) + 3).extract_additively(x + 1)\n",
      " |      (x + 1)*(x + 2*y) + 3\n",
      " |      \n",
      " |      Sometimes auto-expansion will return a less simplified result\n",
      " |      than desired; gcd_terms might be used in such cases:\n",
      " |      \n",
      " |      >>> from sympy import gcd_terms\n",
      " |      >>> (4*x*(y + 1) + y).extract_additively(x)\n",
      " |      4*x*(y + 1) + x*(4*y + 3) - x*(4*y + 4) + y\n",
      " |      >>> gcd_terms(_)\n",
      " |      x*(4*y + 3) + y\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      extract_multiplicatively\n",
      " |      coeff\n",
      " |      as_coefficient\n",
      " |  \n",
      " |  extract_branch_factor(self, allow_half=False)\n",
      " |      Try to write self as ``exp_polar(2*pi*I*n)*z`` in a nice way.\n",
      " |      Return (z, n).\n",
      " |      \n",
      " |      >>> from sympy import exp_polar, I, pi\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> exp_polar(I*pi).extract_branch_factor()\n",
      " |      (exp_polar(I*pi), 0)\n",
      " |      >>> exp_polar(2*I*pi).extract_branch_factor()\n",
      " |      (1, 1)\n",
      " |      >>> exp_polar(-pi*I).extract_branch_factor()\n",
      " |      (exp_polar(I*pi), -1)\n",
      " |      >>> exp_polar(3*pi*I + x).extract_branch_factor()\n",
      " |      (exp_polar(x + I*pi), 1)\n",
      " |      >>> (y*exp_polar(-5*pi*I)*exp_polar(3*pi*I + 2*pi*x)).extract_branch_factor()\n",
      " |      (y*exp_polar(2*pi*x), -1)\n",
      " |      >>> exp_polar(-I*pi/2).extract_branch_factor()\n",
      " |      (exp_polar(-I*pi/2), 0)\n",
      " |      \n",
      " |      If allow_half is True, also extract exp_polar(I*pi):\n",
      " |      \n",
      " |      >>> exp_polar(I*pi).extract_branch_factor(allow_half=True)\n",
      " |      (1, 1/2)\n",
      " |      >>> exp_polar(2*I*pi).extract_branch_factor(allow_half=True)\n",
      " |      (1, 1)\n",
      " |      >>> exp_polar(3*I*pi).extract_branch_factor(allow_half=True)\n",
      " |      (1, 3/2)\n",
      " |      >>> exp_polar(-I*pi).extract_branch_factor(allow_half=True)\n",
      " |      (1, -1/2)\n",
      " |  \n",
      " |  extract_multiplicatively(self, c)\n",
      " |      Return None if it's not possible to make self in the form\n",
      " |      c * something in a nice way, i.e. preserving the properties\n",
      " |      of arguments of self.\n",
      " |      \n",
      " |      >>> from sympy import symbols, Rational\n",
      " |      \n",
      " |      >>> x, y = symbols('x,y', real=True)\n",
      " |      \n",
      " |      >>> ((x*y)**3).extract_multiplicatively(x**2 * y)\n",
      " |      x*y**2\n",
      " |      \n",
      " |      >>> ((x*y)**3).extract_multiplicatively(x**4 * y)\n",
      " |      \n",
      " |      >>> (2*x).extract_multiplicatively(2)\n",
      " |      x\n",
      " |      \n",
      " |      >>> (2*x).extract_multiplicatively(3)\n",
      " |      \n",
      " |      >>> (Rational(1, 2)*x).extract_multiplicatively(3)\n",
      " |      x/6\n",
      " |  \n",
      " |  factor(self, *gens, **args)\n",
      " |      See the factor() function in sympy.polys.polytools\n",
      " |  \n",
      " |  fourier_series(self, limits=None)\n",
      " |      Compute fourier sine/cosine series of self.\n",
      " |      \n",
      " |      See the docstring of the :func:`fourier_series` in sympy.series.fourier\n",
      " |      for more information.\n",
      " |  \n",
      " |  fps(self, x=None, x0=0, dir=1, hyper=True, order=4, rational=True, full=False)\n",
      " |      Compute formal power power series of self.\n",
      " |      \n",
      " |      See the docstring of the :func:`fps` function in sympy.series.formal for\n",
      " |      more information.\n",
      " |  \n",
      " |  getO(self)\n",
      " |      Returns the additive O(..) symbol if there is one, else None.\n",
      " |  \n",
      " |  getn(self)\n",
      " |      Returns the order of the expression.\n",
      " |      \n",
      " |      The order is determined either from the O(...) term. If there\n",
      " |      is no O(...) term, it returns None.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import O\n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> (1 + x + O(x**2)).getn()\n",
      " |      2\n",
      " |      >>> (1 + x).getn()\n",
      " |  \n",
      " |  integrate(self, *args, **kwargs)\n",
      " |      See the integrate function in sympy.integrals\n",
      " |  \n",
      " |  invert(self, g, *gens, **args)\n",
      " |      Return the multiplicative inverse of ``self`` mod ``g``\n",
      " |      where ``self`` (and ``g``) may be symbolic expressions).\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      sympy.core.numbers.mod_inverse, sympy.polys.polytools.invert\n",
      " |  \n",
      " |  is_algebraic_expr(self, *syms)\n",
      " |      This tests whether a given expression is algebraic or not, in the\n",
      " |      given symbols, syms. When syms is not given, all free symbols\n",
      " |      will be used. The rational function does not have to be in expanded\n",
      " |      or in any kind of canonical form.\n",
      " |      \n",
      " |      This function returns False for expressions that are \"algebraic\n",
      " |      expressions\" with symbolic exponents. This is a simple extension to the\n",
      " |      is_rational_function, including rational exponentiation.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Symbol, sqrt\n",
      " |      >>> x = Symbol('x', real=True)\n",
      " |      >>> sqrt(1 + x).is_rational_function()\n",
      " |      False\n",
      " |      >>> sqrt(1 + x).is_algebraic_expr()\n",
      " |      True\n",
      " |      \n",
      " |      This function does not attempt any nontrivial simplifications that may\n",
      " |      result in an expression that does not appear to be an algebraic\n",
      " |      expression to become one.\n",
      " |      \n",
      " |      >>> from sympy import exp, factor\n",
      " |      >>> a = sqrt(exp(x)**2 + 2*exp(x) + 1)/(exp(x) + 1)\n",
      " |      >>> a.is_algebraic_expr(x)\n",
      " |      False\n",
      " |      >>> factor(a).is_algebraic_expr()\n",
      " |      True\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      is_rational_function()\n",
      " |      \n",
      " |      References\n",
      " |      ==========\n",
      " |      \n",
      " |      - http://en.wikipedia.org/wiki/Algebraic_expression\n",
      " |  \n",
      " |  is_constant(self, *wrt, **flags)\n",
      " |      Return True if self is constant, False if not, or None if\n",
      " |      the constancy could not be determined conclusively.\n",
      " |      \n",
      " |      If an expression has no free symbols then it is a constant. If\n",
      " |      there are free symbols it is possible that the expression is a\n",
      " |      constant, perhaps (but not necessarily) zero. To test such\n",
      " |      expressions, two strategies are tried:\n",
      " |      \n",
      " |      1) numerical evaluation at two random points. If two such evaluations\n",
      " |      give two different values and the values have a precision greater than\n",
      " |      1 then self is not constant. If the evaluations agree or could not be\n",
      " |      obtained with any precision, no decision is made. The numerical testing\n",
      " |      is done only if ``wrt`` is different than the free symbols.\n",
      " |      \n",
      " |      2) differentiation with respect to variables in 'wrt' (or all free\n",
      " |      symbols if omitted) to see if the expression is constant or not. This\n",
      " |      will not always lead to an expression that is zero even though an\n",
      " |      expression is constant (see added test in test_expr.py). If\n",
      " |      all derivatives are zero then self is constant with respect to the\n",
      " |      given symbols.\n",
      " |      \n",
      " |      If neither evaluation nor differentiation can prove the expression is\n",
      " |      constant, None is returned unless two numerical values happened to be\n",
      " |      the same and the flag ``failing_number`` is True -- in that case the\n",
      " |      numerical value will be returned.\n",
      " |      \n",
      " |      If flag simplify=False is passed, self will not be simplified;\n",
      " |      the default is True since self should be simplified before testing.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import cos, sin, Sum, S, pi\n",
      " |      >>> from sympy.abc import a, n, x, y\n",
      " |      >>> x.is_constant()\n",
      " |      False\n",
      " |      >>> S(2).is_constant()\n",
      " |      True\n",
      " |      >>> Sum(x, (x, 1, 10)).is_constant()\n",
      " |      True\n",
      " |      >>> Sum(x, (x, 1, n)).is_constant()\n",
      " |      False\n",
      " |      >>> Sum(x, (x, 1, n)).is_constant(y)\n",
      " |      True\n",
      " |      >>> Sum(x, (x, 1, n)).is_constant(n)\n",
      " |      False\n",
      " |      >>> Sum(x, (x, 1, n)).is_constant(x)\n",
      " |      True\n",
      " |      >>> eq = a*cos(x)**2 + a*sin(x)**2 - a\n",
      " |      >>> eq.is_constant()\n",
      " |      True\n",
      " |      >>> eq.subs({x: pi, a: 2}) == eq.subs({x: pi, a: 3}) == 0\n",
      " |      True\n",
      " |      \n",
      " |      >>> (0**x).is_constant()\n",
      " |      False\n",
      " |      >>> x.is_constant()\n",
      " |      False\n",
      " |      >>> (x**x).is_constant()\n",
      " |      False\n",
      " |      >>> one = cos(x)**2 + sin(x)**2\n",
      " |      >>> one.is_constant()\n",
      " |      True\n",
      " |      >>> ((one - 1)**(x + 1)).is_constant() in (True, False) # could be 0 or 1\n",
      " |      True\n",
      " |  \n",
      " |  is_polynomial(self, *syms)\n",
      " |      Return True if self is a polynomial in syms and False otherwise.\n",
      " |      \n",
      " |      This checks if self is an exact polynomial in syms.  This function\n",
      " |      returns False for expressions that are \"polynomials\" with symbolic\n",
      " |      exponents.  Thus, you should be able to apply polynomial algorithms to\n",
      " |      expressions for which this returns True, and Poly(expr, \\*syms) should\n",
      " |      work if and only if expr.is_polynomial(\\*syms) returns True. The\n",
      " |      polynomial does not have to be in expanded form.  If no symbols are\n",
      " |      given, all free symbols in the expression will be used.\n",
      " |      \n",
      " |      This is not part of the assumptions system.  You cannot do\n",
      " |      Symbol('z', polynomial=True).\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Symbol\n",
      " |      >>> x = Symbol('x')\n",
      " |      >>> ((x**2 + 1)**4).is_polynomial(x)\n",
      " |      True\n",
      " |      >>> ((x**2 + 1)**4).is_polynomial()\n",
      " |      True\n",
      " |      >>> (2**x + 1).is_polynomial(x)\n",
      " |      False\n",
      " |      \n",
      " |      \n",
      " |      >>> n = Symbol('n', nonnegative=True, integer=True)\n",
      " |      >>> (x**n + 1).is_polynomial(x)\n",
      " |      False\n",
      " |      \n",
      " |      This function does not attempt any nontrivial simplifications that may\n",
      " |      result in an expression that does not appear to be a polynomial to\n",
      " |      become one.\n",
      " |      \n",
      " |      >>> from sympy import sqrt, factor, cancel\n",
      " |      >>> y = Symbol('y', positive=True)\n",
      " |      >>> a = sqrt(y**2 + 2*y + 1)\n",
      " |      >>> a.is_polynomial(y)\n",
      " |      False\n",
      " |      >>> factor(a)\n",
      " |      y + 1\n",
      " |      >>> factor(a).is_polynomial(y)\n",
      " |      True\n",
      " |      \n",
      " |      >>> b = (y**2 + 2*y + 1)/(y + 1)\n",
      " |      >>> b.is_polynomial(y)\n",
      " |      False\n",
      " |      >>> cancel(b)\n",
      " |      y + 1\n",
      " |      >>> cancel(b).is_polynomial(y)\n",
      " |      True\n",
      " |      \n",
      " |      See also .is_rational_function()\n",
      " |  \n",
      " |  is_rational_function(self, *syms)\n",
      " |      Test whether function is a ratio of two polynomials in the given\n",
      " |      symbols, syms. When syms is not given, all free symbols will be used.\n",
      " |      The rational function does not have to be in expanded or in any kind of\n",
      " |      canonical form.\n",
      " |      \n",
      " |      This function returns False for expressions that are \"rational\n",
      " |      functions\" with symbolic exponents.  Thus, you should be able to call\n",
      " |      .as_numer_denom() and apply polynomial algorithms to the result for\n",
      " |      expressions for which this returns True.\n",
      " |      \n",
      " |      This is not part of the assumptions system.  You cannot do\n",
      " |      Symbol('z', rational_function=True).\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Symbol, sin\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      \n",
      " |      >>> (x/y).is_rational_function()\n",
      " |      True\n",
      " |      \n",
      " |      >>> (x**2).is_rational_function()\n",
      " |      True\n",
      " |      \n",
      " |      >>> (x/sin(y)).is_rational_function(y)\n",
      " |      False\n",
      " |      \n",
      " |      >>> n = Symbol('n', integer=True)\n",
      " |      >>> (x**n + 1).is_rational_function(x)\n",
      " |      False\n",
      " |      \n",
      " |      This function does not attempt any nontrivial simplifications that may\n",
      " |      result in an expression that does not appear to be a rational function\n",
      " |      to become one.\n",
      " |      \n",
      " |      >>> from sympy import sqrt, factor\n",
      " |      >>> y = Symbol('y', positive=True)\n",
      " |      >>> a = sqrt(y**2 + 2*y + 1)/y\n",
      " |      >>> a.is_rational_function(y)\n",
      " |      False\n",
      " |      >>> factor(a)\n",
      " |      (y + 1)/y\n",
      " |      >>> factor(a).is_rational_function(y)\n",
      " |      True\n",
      " |      \n",
      " |      See also is_algebraic_expr().\n",
      " |  \n",
      " |  leadterm(self, x)\n",
      " |      Returns the leading term a*x**b as a tuple (a, b).\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> (1+x+x**2).leadterm(x)\n",
      " |      (1, 0)\n",
      " |      >>> (1/x**2+x+x**2).leadterm(x)\n",
      " |      (1, -2)\n",
      " |  \n",
      " |  limit(self, x, xlim, dir='+')\n",
      " |      Compute limit x->xlim.\n",
      " |  \n",
      " |  lseries(self, x=None, x0=0, dir='+', logx=None)\n",
      " |      Wrapper for series yielding an iterator of the terms of the series.\n",
      " |      \n",
      " |      Note: an infinite series will yield an infinite iterator. The following,\n",
      " |      for exaxmple, will never terminate. It will just keep printing terms\n",
      " |      of the sin(x) series::\n",
      " |      \n",
      " |        for term in sin(x).lseries(x):\n",
      " |            print term\n",
      " |      \n",
      " |      The advantage of lseries() over nseries() is that many times you are\n",
      " |      just interested in the next term in the series (i.e. the first term for\n",
      " |      example), but you don't know how many you should ask for in nseries()\n",
      " |      using the \"n\" parameter.\n",
      " |      \n",
      " |      See also nseries().\n",
      " |  \n",
      " |  normal(self)\n",
      " |  \n",
      " |  nseries(self, x=None, x0=0, n=6, dir='+', logx=None)\n",
      " |      Wrapper to _eval_nseries if assumptions allow, else to series.\n",
      " |      \n",
      " |      If x is given, x0 is 0, dir='+', and self has x, then _eval_nseries is\n",
      " |      called. This calculates \"n\" terms in the innermost expressions and\n",
      " |      then builds up the final series just by \"cross-multiplying\" everything\n",
      " |      out.\n",
      " |      \n",
      " |      The optional ``logx`` parameter can be used to replace any log(x) in the\n",
      " |      returned series with a symbolic value to avoid evaluating log(x) at 0. A\n",
      " |      symbol to use in place of log(x) should be provided.\n",
      " |      \n",
      " |      Advantage -- it's fast, because we don't have to determine how many\n",
      " |      terms we need to calculate in advance.\n",
      " |      \n",
      " |      Disadvantage -- you may end up with less terms than you may have\n",
      " |      expected, but the O(x**n) term appended will always be correct and\n",
      " |      so the result, though perhaps shorter, will also be correct.\n",
      " |      \n",
      " |      If any of those assumptions is not met, this is treated like a\n",
      " |      wrapper to series which will try harder to return the correct\n",
      " |      number of terms.\n",
      " |      \n",
      " |      See also lseries().\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import sin, log, Symbol\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> sin(x).nseries(x, 0, 6)\n",
      " |      x - x**3/6 + x**5/120 + O(x**6)\n",
      " |      >>> log(x+1).nseries(x, 0, 5)\n",
      " |      x - x**2/2 + x**3/3 - x**4/4 + O(x**5)\n",
      " |      \n",
      " |      Handling of the ``logx`` parameter --- in the following example the\n",
      " |      expansion fails since ``sin`` does not have an asymptotic expansion\n",
      " |      at -oo (the limit of log(x) as x approaches 0):\n",
      " |      \n",
      " |      >>> e = sin(log(x))\n",
      " |      >>> e.nseries(x, 0, 6)\n",
      " |      Traceback (most recent call last):\n",
      " |      ...\n",
      " |      PoleError: ...\n",
      " |      ...\n",
      " |      >>> logx = Symbol('logx')\n",
      " |      >>> e.nseries(x, 0, 6, logx=logx)\n",
      " |      sin(logx)\n",
      " |      \n",
      " |      In the following example, the expansion works but gives only an Order term\n",
      " |      unless the ``logx`` parameter is used:\n",
      " |      \n",
      " |      >>> e = x**y\n",
      " |      >>> e.nseries(x, 0, 2)\n",
      " |      O(log(x)**2)\n",
      " |      >>> e.nseries(x, 0, 2, logx=logx)\n",
      " |      exp(logx*y)\n",
      " |  \n",
      " |  nsimplify(self, constants=[], tolerance=None, full=False)\n",
      " |      See the nsimplify function in sympy.simplify\n",
      " |  \n",
      " |  powsimp(self, *args, **kwargs)\n",
      " |      See the powsimp function in sympy.simplify\n",
      " |  \n",
      " |  primitive(self)\n",
      " |      Return the positive Rational that can be extracted non-recursively\n",
      " |      from every term of self (i.e., self is treated like an Add). This is\n",
      " |      like the as_coeff_Mul() method but primitive always extracts a positive\n",
      " |      Rational (never a negative or a Float).\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> (3*(x + 1)**2).primitive()\n",
      " |      (3, (x + 1)**2)\n",
      " |      >>> a = (6*x + 2); a.primitive()\n",
      " |      (2, 3*x + 1)\n",
      " |      >>> b = (x/2 + 3); b.primitive()\n",
      " |      (1/2, x + 6)\n",
      " |      >>> (a*b).primitive() == (1, a*b)\n",
      " |      True\n",
      " |  \n",
      " |  radsimp(self, **kwargs)\n",
      " |      See the radsimp function in sympy.simplify\n",
      " |  \n",
      " |  ratsimp(self)\n",
      " |      See the ratsimp function in sympy.simplify\n",
      " |  \n",
      " |  refine(self, assumption=True)\n",
      " |      See the refine function in sympy.assumptions\n",
      " |  \n",
      " |  removeO(self)\n",
      " |      Removes the additive O(..) symbol if there is one\n",
      " |  \n",
      " |  round(self, p=0)\n",
      " |      Return x rounded to the given decimal place.\n",
      " |      \n",
      " |      If a complex number would results, apply round to the real\n",
      " |      and imaginary components of the number.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import pi, E, I, S, Add, Mul, Number\n",
      " |      >>> S(10.5).round()\n",
      " |      11.\n",
      " |      >>> pi.round()\n",
      " |      3.\n",
      " |      >>> pi.round(2)\n",
      " |      3.14\n",
      " |      >>> (2*pi + E*I).round()\n",
      " |      6. + 3.*I\n",
      " |      \n",
      " |      The round method has a chopping effect:\n",
      " |      \n",
      " |      >>> (2*pi + I/10).round()\n",
      " |      6.\n",
      " |      >>> (pi/10 + 2*I).round()\n",
      " |      2.*I\n",
      " |      >>> (pi/10 + E*I).round(2)\n",
      " |      0.31 + 2.72*I\n",
      " |      \n",
      " |      Notes\n",
      " |      =====\n",
      " |      \n",
      " |      Do not confuse the Python builtin function, round, with the\n",
      " |      SymPy method of the same name. The former always returns a float\n",
      " |      (or raises an error if applied to a complex value) while the\n",
      " |      latter returns either a Number or a complex number:\n",
      " |      \n",
      " |      >>> isinstance(round(S(123), -2), Number)\n",
      " |      False\n",
      " |      >>> isinstance(S(123).round(-2), Number)\n",
      " |      True\n",
      " |      >>> isinstance((3*I).round(), Mul)\n",
      " |      True\n",
      " |      >>> isinstance((1 + 3*I).round(), Add)\n",
      " |      True\n",
      " |  \n",
      " |  separate(self, deep=False, force=False)\n",
      " |      See the separate function in sympy.simplify\n",
      " |  \n",
      " |  series(self, x=None, x0=0, n=6, dir='+', logx=None)\n",
      " |      Series expansion of \"self\" around ``x = x0`` yielding either terms of\n",
      " |      the series one by one (the lazy series given when n=None), else\n",
      " |      all the terms at once when n != None.\n",
      " |      \n",
      " |      Returns the series expansion of \"self\" around the point ``x = x0``\n",
      " |      with respect to ``x`` up to ``O((x - x0)**n, x, x0)`` (default n is 6).\n",
      " |      \n",
      " |      If ``x=None`` and ``self`` is univariate, the univariate symbol will\n",
      " |      be supplied, otherwise an error will be raised.\n",
      " |      \n",
      " |      >>> from sympy import cos, exp\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> cos(x).series()\n",
      " |      1 - x**2/2 + x**4/24 + O(x**6)\n",
      " |      >>> cos(x).series(n=4)\n",
      " |      1 - x**2/2 + O(x**4)\n",
      " |      >>> cos(x).series(x, x0=1, n=2)\n",
      " |      cos(1) - (x - 1)*sin(1) + O((x - 1)**2, (x, 1))\n",
      " |      >>> e = cos(x + exp(y))\n",
      " |      >>> e.series(y, n=2)\n",
      " |      cos(x + 1) - y*sin(x + 1) + O(y**2)\n",
      " |      >>> e.series(x, n=2)\n",
      " |      cos(exp(y)) - x*sin(exp(y)) + O(x**2)\n",
      " |      \n",
      " |      If ``n=None`` then a generator of the series terms will be returned.\n",
      " |      \n",
      " |      >>> term=cos(x).series(n=None)\n",
      " |      >>> [next(term) for i in range(2)]\n",
      " |      [1, -x**2/2]\n",
      " |      \n",
      " |      For ``dir=+`` (default) the series is calculated from the right and\n",
      " |      for ``dir=-`` the series from the left. For smooth functions this\n",
      " |      flag will not alter the results.\n",
      " |      \n",
      " |      >>> abs(x).series(dir=\"+\")\n",
      " |      x\n",
      " |      >>> abs(x).series(dir=\"-\")\n",
      " |      -x\n",
      " |  \n",
      " |  simplify(self, ratio=1.7, measure=None)\n",
      " |      See the simplify function in sympy.simplify\n",
      " |  \n",
      " |  sort_key(self, order=None)\n",
      " |      Return a sort key.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.core import S, I\n",
      " |      \n",
      " |      >>> sorted([S(1)/2, I, -I], key=lambda x: x.sort_key())\n",
      " |      [1/2, -I, I]\n",
      " |      \n",
      " |      >>> S(\"[x, 1/x, 1/x**2, x**2, x**(1/2), x**(1/4), x**(3/2)]\")\n",
      " |      [x, 1/x, x**(-2), x**2, sqrt(x), x**(1/4), x**(3/2)]\n",
      " |      >>> sorted(_, key=lambda x: x.sort_key())\n",
      " |      [x**(-2), 1/x, x**(1/4), sqrt(x), x, x**(3/2), x**2]\n",
      " |  \n",
      " |  taylor_term(self, n, x, *previous_terms)\n",
      " |      General method for the taylor term.\n",
      " |      \n",
      " |      This method is slow, because it differentiates n-times. Subclasses can\n",
      " |      redefine it to make it faster by using the \"previous_terms\".\n",
      " |  \n",
      " |  together(self, *args, **kwargs)\n",
      " |      See the together function in sympy.polys\n",
      " |  \n",
      " |  transpose(self)\n",
      " |  \n",
      " |  trigsimp(self, **args)\n",
      " |      See the trigsimp function in sympy.simplify\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data descriptors inherited from sympy.core.expr.Expr:\n",
      " |  \n",
      " |  is_number\n",
      " |      Returns True if ``self`` has no free symbols.\n",
      " |      It will be faster than ``if not self.free_symbols``, however, since\n",
      " |      ``is_number`` will fail as soon as it hits a free symbol.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import log, Integral\n",
      " |      >>> from sympy.abc import x\n",
      " |      \n",
      " |      >>> x.is_number\n",
      " |      False\n",
      " |      >>> (2*x).is_number\n",
      " |      False\n",
      " |      >>> (2 + log(2)).is_number\n",
      " |      True\n",
      " |      >>> (2 + Integral(2, x)).is_number\n",
      " |      False\n",
      " |      >>> (2 + Integral(2, (x, 1, 2))).is_number\n",
      " |      True\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Methods inherited from sympy.core.basic.Basic:\n",
      " |  \n",
      " |  __eq__(self, other)\n",
      " |      Return a boolean indicating whether a == b on the basis of\n",
      " |      their symbolic trees.\n",
      " |      \n",
      " |      This is the same as a.compare(b) == 0 but faster.\n",
      " |      \n",
      " |      Notes\n",
      " |      =====\n",
      " |      \n",
      " |      If a class that overrides __eq__() needs to retain the\n",
      " |      implementation of __hash__() from a parent class, the\n",
      " |      interpreter must be told this explicitly by setting __hash__ =\n",
      " |      <ParentClass>.__hash__. Otherwise the inheritance of __hash__()\n",
      " |      will be blocked, just as if __hash__ had been explicitly set to\n",
      " |      None.\n",
      " |      \n",
      " |      References\n",
      " |      ==========\n",
      " |      \n",
      " |      from http://docs.python.org/dev/reference/datamodel.html#object.__hash__\n",
      " |  \n",
      " |  __getnewargs__(self)\n",
      " |  \n",
      " |  __getstate__(self)\n",
      " |  \n",
      " |  __hash__(self)\n",
      " |      Return hash(self).\n",
      " |  \n",
      " |  __ne__(self, other)\n",
      " |      a != b  -> Compare two symbolic trees and see whether they are different\n",
      " |      \n",
      " |      this is the same as:\n",
      " |      \n",
      " |        a.compare(b) != 0\n",
      " |      \n",
      " |      but faster\n",
      " |  \n",
      " |  __reduce_ex__(self, proto)\n",
      " |      Pickling support.\n",
      " |  \n",
      " |  __repr__(self)\n",
      " |      Method to return the string representation.\n",
      " |      Return the expression as a string.\n",
      " |  \n",
      " |  __setstate__(self, state)\n",
      " |  \n",
      " |  __str__(self)\n",
      " |      Return str(self).\n",
      " |  \n",
      " |  as_poly(self, *gens, **args)\n",
      " |      Converts ``self`` to a polynomial or returns ``None``.\n",
      " |      \n",
      " |      >>> from sympy import sin\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      \n",
      " |      >>> print((x**2 + x*y).as_poly())\n",
      " |      Poly(x**2 + x*y, x, y, domain='ZZ')\n",
      " |      \n",
      " |      >>> print((x**2 + x*y).as_poly(x, y))\n",
      " |      Poly(x**2 + x*y, x, y, domain='ZZ')\n",
      " |      \n",
      " |      >>> print((x**2 + sin(y)).as_poly(x, y))\n",
      " |      None\n",
      " |  \n",
      " |  atoms(self, *types)\n",
      " |      Returns the atoms that form the current object.\n",
      " |      \n",
      " |      By default, only objects that are truly atomic and can't\n",
      " |      be divided into smaller pieces are returned: symbols, numbers,\n",
      " |      and number symbols like I and pi. It is possible to request\n",
      " |      atoms of any type, however, as demonstrated below.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import I, pi, sin\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms()\n",
      " |      {1, 2, I, pi, x, y}\n",
      " |      \n",
      " |      If one or more types are given, the results will contain only\n",
      " |      those types of atoms.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Number, NumberSymbol, Symbol\n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(Symbol)\n",
      " |      {x, y}\n",
      " |      \n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(Number)\n",
      " |      {1, 2}\n",
      " |      \n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(Number, NumberSymbol)\n",
      " |      {1, 2, pi}\n",
      " |      \n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(Number, NumberSymbol, I)\n",
      " |      {1, 2, I, pi}\n",
      " |      \n",
      " |      Note that I (imaginary unit) and zoo (complex infinity) are special\n",
      " |      types of number symbols and are not part of the NumberSymbol class.\n",
      " |      \n",
      " |      The type can be given implicitly, too:\n",
      " |      \n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(x) # x is a Symbol\n",
      " |      {x, y}\n",
      " |      \n",
      " |      Be careful to check your assumptions when using the implicit option\n",
      " |      since ``S(1).is_Integer = True`` but ``type(S(1))`` is ``One``, a special type\n",
      " |      of sympy atom, while ``type(S(2))`` is type ``Integer`` and will find all\n",
      " |      integers in an expression:\n",
      " |      \n",
      " |      >>> from sympy import S\n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(S(1))\n",
      " |      {1}\n",
      " |      \n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(S(2))\n",
      " |      {1, 2}\n",
      " |      \n",
      " |      Finally, arguments to atoms() can select more than atomic atoms: any\n",
      " |      sympy type (loaded in core/__init__.py) can be listed as an argument\n",
      " |      and those types of \"atoms\" as found in scanning the arguments of the\n",
      " |      expression recursively:\n",
      " |      \n",
      " |      >>> from sympy import Function, Mul\n",
      " |      >>> from sympy.core.function import AppliedUndef\n",
      " |      >>> f = Function('f')\n",
      " |      >>> (1 + f(x) + 2*sin(y + I*pi)).atoms(Function)\n",
      " |      {f(x), sin(y + I*pi)}\n",
      " |      >>> (1 + f(x) + 2*sin(y + I*pi)).atoms(AppliedUndef)\n",
      " |      {f(x)}\n",
      " |      \n",
      " |      >>> (1 + x + 2*sin(y + I*pi)).atoms(Mul)\n",
      " |      {I*pi, 2*sin(y + I*pi)}\n",
      " |  \n",
      " |  compare(self, other)\n",
      " |      Return -1, 0, 1 if the object is smaller, equal, or greater than other.\n",
      " |      \n",
      " |      Not in the mathematical sense. If the object is of a different type\n",
      " |      from the \"other\" then their classes are ordered according to\n",
      " |      the sorted_classes list.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> x.compare(y)\n",
      " |      -1\n",
      " |      >>> x.compare(x)\n",
      " |      0\n",
      " |      >>> y.compare(x)\n",
      " |      1\n",
      " |  \n",
      " |  copy(self)\n",
      " |  \n",
      " |  count(self, query)\n",
      " |      Count the number of matching subexpressions.\n",
      " |  \n",
      " |  doit(self, **hints)\n",
      " |      Evaluate objects that are not evaluated by default like limits,\n",
      " |      integrals, sums and products. All objects of this kind will be\n",
      " |      evaluated recursively, unless some species were excluded via 'hints'\n",
      " |      or unless the 'deep' hint was set to 'False'.\n",
      " |      \n",
      " |      >>> from sympy import Integral\n",
      " |      >>> from sympy.abc import x\n",
      " |      \n",
      " |      >>> 2*Integral(x, x)\n",
      " |      2*Integral(x, x)\n",
      " |      \n",
      " |      >>> (2*Integral(x, x)).doit()\n",
      " |      x**2\n",
      " |      \n",
      " |      >>> (2*Integral(x, x)).doit(deep=False)\n",
      " |      2*Integral(x, x)\n",
      " |  \n",
      " |  dummy_eq(self, other, symbol=None)\n",
      " |      Compare two expressions and handle dummy symbols.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Dummy\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      \n",
      " |      >>> u = Dummy('u')\n",
      " |      \n",
      " |      >>> (u**2 + 1).dummy_eq(x**2 + 1)\n",
      " |      True\n",
      " |      >>> (u**2 + 1) == (x**2 + 1)\n",
      " |      False\n",
      " |      \n",
      " |      >>> (u**2 + y).dummy_eq(x**2 + y, x)\n",
      " |      True\n",
      " |      >>> (u**2 + y).dummy_eq(x**2 + y, y)\n",
      " |      False\n",
      " |  \n",
      " |  find(self, query, group=False)\n",
      " |      Find all subexpressions matching a query.\n",
      " |  \n",
      " |  has(self, *patterns)\n",
      " |      Test whether any subexpression matches any of the patterns.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import sin\n",
      " |      >>> from sympy.abc import x, y, z\n",
      " |      >>> (x**2 + sin(x*y)).has(z)\n",
      " |      False\n",
      " |      >>> (x**2 + sin(x*y)).has(x, y, z)\n",
      " |      True\n",
      " |      >>> x.has(x)\n",
      " |      True\n",
      " |      \n",
      " |      Note ``has`` is a structural algorithm with no knowledge of\n",
      " |      mathematics. Consider the following half-open interval:\n",
      " |      \n",
      " |      >>> from sympy.sets import Interval\n",
      " |      >>> i = Interval.Lopen(0, 5); i\n",
      " |      Interval.Lopen(0, 5)\n",
      " |      >>> i.args\n",
      " |      (0, 5, True, False)\n",
      " |      >>> i.has(4)  # there is no \"4\" in the arguments\n",
      " |      False\n",
      " |      >>> i.has(0)  # there *is* a \"0\" in the arguments\n",
      " |      True\n",
      " |      \n",
      " |      Instead, use ``contains`` to determine whether a number is in the\n",
      " |      interval or not:\n",
      " |      \n",
      " |      >>> i.contains(4)\n",
      " |      True\n",
      " |      >>> i.contains(0)\n",
      " |      False\n",
      " |      \n",
      " |      \n",
      " |      Note that ``expr.has(*patterns)`` is exactly equivalent to\n",
      " |      ``any(expr.has(p) for p in patterns)``. In particular, ``False`` is\n",
      " |      returned when the list of patterns is empty.\n",
      " |      \n",
      " |      >>> x.has()\n",
      " |      False\n",
      " |  \n",
      " |  is_hypergeometric(self, k)\n",
      " |  \n",
      " |  match(self, pattern, old=False)\n",
      " |      Pattern matching.\n",
      " |      \n",
      " |      Wild symbols match all.\n",
      " |      \n",
      " |      Return ``None`` when expression (self) does not match\n",
      " |      with pattern. Otherwise return a dictionary such that::\n",
      " |      \n",
      " |        pattern.xreplace(self.match(pattern)) == self\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Wild\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> p = Wild(\"p\")\n",
      " |      >>> q = Wild(\"q\")\n",
      " |      >>> r = Wild(\"r\")\n",
      " |      >>> e = (x+y)**(x+y)\n",
      " |      >>> e.match(p**p)\n",
      " |      {p_: x + y}\n",
      " |      >>> e.match(p**q)\n",
      " |      {p_: x + y, q_: x + y}\n",
      " |      >>> e = (2*x)**2\n",
      " |      >>> e.match(p*q**r)\n",
      " |      {p_: 4, q_: x, r_: 2}\n",
      " |      >>> (p*q**r).xreplace(e.match(p*q**r))\n",
      " |      4*x**2\n",
      " |      \n",
      " |      The ``old`` flag will give the old-style pattern matching where\n",
      " |      expressions and patterns are essentially solved to give the\n",
      " |      match. Both of the following give None unless ``old=True``:\n",
      " |      \n",
      " |      >>> (x - 2).match(p - x, old=True)\n",
      " |      {p_: 2*x - 2}\n",
      " |      >>> (2/x).match(p*x, old=True)\n",
      " |      {p_: 2/x**2}\n",
      " |  \n",
      " |  matches(self, expr, repl_dict={}, old=False)\n",
      " |      Helper method for match() that looks for a match between Wild symbols\n",
      " |      in self and expressions in expr.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import symbols, Wild, Basic\n",
      " |      >>> a, b, c = symbols('a b c')\n",
      " |      >>> x = Wild('x')\n",
      " |      >>> Basic(a + x, x).matches(Basic(a + b, c)) is None\n",
      " |      True\n",
      " |      >>> Basic(a + x, x).matches(Basic(a + b + c, b + c))\n",
      " |      {x_: b + c}\n",
      " |  \n",
      " |  rcall(self, *args)\n",
      " |      Apply on the argument recursively through the expression tree.\n",
      " |      \n",
      " |      This method is used to simulate a common abuse of notation for\n",
      " |      operators. For instance in SymPy the the following will not work:\n",
      " |      \n",
      " |      ``(x+Lambda(y, 2*y))(z) == x+2*z``,\n",
      " |      \n",
      " |      however you can use\n",
      " |      \n",
      " |      >>> from sympy import Lambda\n",
      " |      >>> from sympy.abc import x, y, z\n",
      " |      >>> (x + Lambda(y, 2*y)).rcall(z)\n",
      " |      x + 2*z\n",
      " |  \n",
      " |  replace(self, query, value, map=False, simultaneous=True, exact=False)\n",
      " |      Replace matching subexpressions of ``self`` with ``value``.\n",
      " |      \n",
      " |      If ``map = True`` then also return the mapping {old: new} where ``old``\n",
      " |      was a sub-expression found with query and ``new`` is the replacement\n",
      " |      value for it. If the expression itself doesn't match the query, then\n",
      " |      the returned value will be ``self.xreplace(map)`` otherwise it should\n",
      " |      be ``self.subs(ordered(map.items()))``.\n",
      " |      \n",
      " |      Traverses an expression tree and performs replacement of matching\n",
      " |      subexpressions from the bottom to the top of the tree. The default\n",
      " |      approach is to do the replacement in a simultaneous fashion so\n",
      " |      changes made are targeted only once. If this is not desired or causes\n",
      " |      problems, ``simultaneous`` can be set to False. In addition, if an\n",
      " |      expression containing more than one Wild symbol is being used to match\n",
      " |      subexpressions and  the ``exact`` flag is True, then the match will only\n",
      " |      succeed if non-zero values are received for each Wild that appears in\n",
      " |      the match pattern.\n",
      " |      \n",
      " |      The list of possible combinations of queries and replacement values\n",
      " |      is listed below:\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      Initial setup\n",
      " |      \n",
      " |          >>> from sympy import log, sin, cos, tan, Wild, Mul, Add\n",
      " |          >>> from sympy.abc import x, y\n",
      " |          >>> f = log(sin(x)) + tan(sin(x**2))\n",
      " |      \n",
      " |      1.1. type -> type\n",
      " |          obj.replace(type, newtype)\n",
      " |      \n",
      " |          When object of type ``type`` is found, replace it with the\n",
      " |          result of passing its argument(s) to ``newtype``.\n",
      " |      \n",
      " |          >>> f.replace(sin, cos)\n",
      " |          log(cos(x)) + tan(cos(x**2))\n",
      " |          >>> sin(x).replace(sin, cos, map=True)\n",
      " |          (cos(x), {sin(x): cos(x)})\n",
      " |          >>> (x*y).replace(Mul, Add)\n",
      " |          x + y\n",
      " |      \n",
      " |      1.2. type -> func\n",
      " |          obj.replace(type, func)\n",
      " |      \n",
      " |          When object of type ``type`` is found, apply ``func`` to its\n",
      " |          argument(s). ``func`` must be written to handle the number\n",
      " |          of arguments of ``type``.\n",
      " |      \n",
      " |          >>> f.replace(sin, lambda arg: sin(2*arg))\n",
      " |          log(sin(2*x)) + tan(sin(2*x**2))\n",
      " |          >>> (x*y).replace(Mul, lambda *args: sin(2*Mul(*args)))\n",
      " |          sin(2*x*y)\n",
      " |      \n",
      " |      2.1. pattern -> expr\n",
      " |          obj.replace(pattern(wild), expr(wild))\n",
      " |      \n",
      " |          Replace subexpressions matching ``pattern`` with the expression\n",
      " |          written in terms of the Wild symbols in ``pattern``.\n",
      " |      \n",
      " |          >>> a = Wild('a')\n",
      " |          >>> f.replace(sin(a), tan(a))\n",
      " |          log(tan(x)) + tan(tan(x**2))\n",
      " |          >>> f.replace(sin(a), tan(a/2))\n",
      " |          log(tan(x/2)) + tan(tan(x**2/2))\n",
      " |          >>> f.replace(sin(a), a)\n",
      " |          log(x) + tan(x**2)\n",
      " |          >>> (x*y).replace(a*x, a)\n",
      " |          y\n",
      " |      \n",
      " |          When the default value of False is used with patterns that have\n",
      " |          more than one Wild symbol, non-intuitive results may be obtained:\n",
      " |      \n",
      " |          >>> b = Wild('b')\n",
      " |          >>> (2*x).replace(a*x + b, b - a)\n",
      " |          2/x\n",
      " |      \n",
      " |          For this reason, the ``exact`` option can be used to make the\n",
      " |          replacement only when the match gives non-zero values for all\n",
      " |          Wild symbols:\n",
      " |      \n",
      " |          >>> (2*x + y).replace(a*x + b, b - a, exact=True)\n",
      " |          y - 2\n",
      " |          >>> (2*x).replace(a*x + b, b - a, exact=True)\n",
      " |          2*x\n",
      " |      \n",
      " |      2.2. pattern -> func\n",
      " |          obj.replace(pattern(wild), lambda wild: expr(wild))\n",
      " |      \n",
      " |          All behavior is the same as in 2.1 but now a function in terms of\n",
      " |          pattern variables is used rather than an expression:\n",
      " |      \n",
      " |          >>> f.replace(sin(a), lambda a: sin(2*a))\n",
      " |          log(sin(2*x)) + tan(sin(2*x**2))\n",
      " |      \n",
      " |      3.1. func -> func\n",
      " |          obj.replace(filter, func)\n",
      " |      \n",
      " |          Replace subexpression ``e`` with ``func(e)`` if ``filter(e)``\n",
      " |          is True.\n",
      " |      \n",
      " |          >>> g = 2*sin(x**3)\n",
      " |          >>> g.replace(lambda expr: expr.is_Number, lambda expr: expr**2)\n",
      " |          4*sin(x**9)\n",
      " |      \n",
      " |      The expression itself is also targeted by the query but is done in\n",
      " |      such a fashion that changes are not made twice.\n",
      " |      \n",
      " |          >>> e = x*(x*y + 1)\n",
      " |          >>> e.replace(lambda x: x.is_Mul, lambda x: 2*x)\n",
      " |          2*x*(2*x*y + 1)\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      subs: substitution of subexpressions as defined by the objects\n",
      " |            themselves.\n",
      " |      xreplace: exact node replacement in expr tree; also capable of\n",
      " |                using matching rules\n",
      " |  \n",
      " |  rewrite(self, *args, **hints)\n",
      " |      Rewrite functions in terms of other functions.\n",
      " |      \n",
      " |      Rewrites expression containing applications of functions\n",
      " |      of one kind in terms of functions of different kind. For\n",
      " |      example you can rewrite trigonometric functions as complex\n",
      " |      exponentials or combinatorial functions as gamma function.\n",
      " |      \n",
      " |      As a pattern this function accepts a list of functions to\n",
      " |      to rewrite (instances of DefinedFunction class). As rule\n",
      " |      you can use string or a destination function instance (in\n",
      " |      this case rewrite() will use the str() function).\n",
      " |      \n",
      " |      There is also the possibility to pass hints on how to rewrite\n",
      " |      the given expressions. For now there is only one such hint\n",
      " |      defined called 'deep'. When 'deep' is set to False it will\n",
      " |      forbid functions to rewrite their contents.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import sin, exp\n",
      " |      >>> from sympy.abc import x\n",
      " |      \n",
      " |      Unspecified pattern:\n",
      " |      \n",
      " |      >>> sin(x).rewrite(exp)\n",
      " |      -I*(exp(I*x) - exp(-I*x))/2\n",
      " |      \n",
      " |      Pattern as a single function:\n",
      " |      \n",
      " |      >>> sin(x).rewrite(sin, exp)\n",
      " |      -I*(exp(I*x) - exp(-I*x))/2\n",
      " |      \n",
      " |      Pattern as a list of functions:\n",
      " |      \n",
      " |      >>> sin(x).rewrite([sin, ], exp)\n",
      " |      -I*(exp(I*x) - exp(-I*x))/2\n",
      " |  \n",
      " |  subs(self, *args, **kwargs)\n",
      " |      Substitutes old for new in an expression after sympifying args.\n",
      " |      \n",
      " |      `args` is either:\n",
      " |        - two arguments, e.g. foo.subs(old, new)\n",
      " |        - one iterable argument, e.g. foo.subs(iterable). The iterable may be\n",
      " |           o an iterable container with (old, new) pairs. In this case the\n",
      " |             replacements are processed in the order given with successive\n",
      " |             patterns possibly affecting replacements already made.\n",
      " |           o a dict or set whose key/value items correspond to old/new pairs.\n",
      " |             In this case the old/new pairs will be sorted by op count and in\n",
      " |             case of a tie, by number of args and the default_sort_key. The\n",
      " |             resulting sorted list is then processed as an iterable container\n",
      " |             (see previous).\n",
      " |      \n",
      " |      If the keyword ``simultaneous`` is True, the subexpressions will not be\n",
      " |      evaluated until all the substitutions have been made.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import pi, exp, limit, oo\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      >>> (1 + x*y).subs(x, pi)\n",
      " |      pi*y + 1\n",
      " |      >>> (1 + x*y).subs({x:pi, y:2})\n",
      " |      1 + 2*pi\n",
      " |      >>> (1 + x*y).subs([(x, pi), (y, 2)])\n",
      " |      1 + 2*pi\n",
      " |      >>> reps = [(y, x**2), (x, 2)]\n",
      " |      >>> (x + y).subs(reps)\n",
      " |      6\n",
      " |      >>> (x + y).subs(reversed(reps))\n",
      " |      x**2 + 2\n",
      " |      \n",
      " |      >>> (x**2 + x**4).subs(x**2, y)\n",
      " |      y**2 + y\n",
      " |      \n",
      " |      To replace only the x**2 but not the x**4, use xreplace:\n",
      " |      \n",
      " |      >>> (x**2 + x**4).xreplace({x**2: y})\n",
      " |      x**4 + y\n",
      " |      \n",
      " |      To delay evaluation until all substitutions have been made,\n",
      " |      set the keyword ``simultaneous`` to True:\n",
      " |      \n",
      " |      >>> (x/y).subs([(x, 0), (y, 0)])\n",
      " |      0\n",
      " |      >>> (x/y).subs([(x, 0), (y, 0)], simultaneous=True)\n",
      " |      nan\n",
      " |      \n",
      " |      This has the added feature of not allowing subsequent substitutions\n",
      " |      to affect those already made:\n",
      " |      \n",
      " |      >>> ((x + y)/y).subs({x + y: y, y: x + y})\n",
      " |      1\n",
      " |      >>> ((x + y)/y).subs({x + y: y, y: x + y}, simultaneous=True)\n",
      " |      y/(x + y)\n",
      " |      \n",
      " |      In order to obtain a canonical result, unordered iterables are\n",
      " |      sorted by count_op length, number of arguments and by the\n",
      " |      default_sort_key to break any ties. All other iterables are left\n",
      " |      unsorted.\n",
      " |      \n",
      " |      >>> from sympy import sqrt, sin, cos\n",
      " |      >>> from sympy.abc import a, b, c, d, e\n",
      " |      \n",
      " |      >>> A = (sqrt(sin(2*x)), a)\n",
      " |      >>> B = (sin(2*x), b)\n",
      " |      >>> C = (cos(2*x), c)\n",
      " |      >>> D = (x, d)\n",
      " |      >>> E = (exp(x), e)\n",
      " |      \n",
      " |      >>> expr = sqrt(sin(2*x))*sin(exp(x)*x)*cos(2*x) + sin(2*x)\n",
      " |      \n",
      " |      >>> expr.subs(dict([A, B, C, D, E]))\n",
      " |      a*c*sin(d*e) + b\n",
      " |      \n",
      " |      The resulting expression represents a literal replacement of the\n",
      " |      old arguments with the new arguments. This may not reflect the\n",
      " |      limiting behavior of the expression:\n",
      " |      \n",
      " |      >>> (x**3 - 3*x).subs({x: oo})\n",
      " |      nan\n",
      " |      \n",
      " |      >>> limit(x**3 - 3*x, x, oo)\n",
      " |      oo\n",
      " |      \n",
      " |      If the substitution will be followed by numerical\n",
      " |      evaluation, it is better to pass the substitution to\n",
      " |      evalf as\n",
      " |      \n",
      " |      >>> (1/x).evalf(subs={x: 3.0}, n=21)\n",
      " |      0.333333333333333333333\n",
      " |      \n",
      " |      rather than\n",
      " |      \n",
      " |      >>> (1/x).subs({x: 3.0}).evalf(21)\n",
      " |      0.333333333333333314830\n",
      " |      \n",
      " |      as the former will ensure that the desired level of precision is\n",
      " |      obtained.\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      replace: replacement capable of doing wildcard-like matching,\n",
      " |               parsing of match, and conditional replacements\n",
      " |      xreplace: exact node replacement in expr tree; also capable of\n",
      " |                using matching rules\n",
      " |      evalf: calculates the given formula to a desired level of precision\n",
      " |  \n",
      " |  xreplace(self, rule)\n",
      " |      Replace occurrences of objects within the expression.\n",
      " |      \n",
      " |      Parameters\n",
      " |      ==========\n",
      " |      rule : dict-like\n",
      " |          Expresses a replacement rule\n",
      " |      \n",
      " |      Returns\n",
      " |      =======\n",
      " |      xreplace : the result of the replacement\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import symbols, pi, exp\n",
      " |      >>> x, y, z = symbols('x y z')\n",
      " |      >>> (1 + x*y).xreplace({x: pi})\n",
      " |      pi*y + 1\n",
      " |      >>> (1 + x*y).xreplace({x: pi, y: 2})\n",
      " |      1 + 2*pi\n",
      " |      \n",
      " |      Replacements occur only if an entire node in the expression tree is\n",
      " |      matched:\n",
      " |      \n",
      " |      >>> (x*y + z).xreplace({x*y: pi})\n",
      " |      z + pi\n",
      " |      >>> (x*y*z).xreplace({x*y: pi})\n",
      " |      x*y*z\n",
      " |      >>> (2*x).xreplace({2*x: y, x: z})\n",
      " |      y\n",
      " |      >>> (2*2*x).xreplace({2*x: y, x: z})\n",
      " |      4*z\n",
      " |      >>> (x + y + 2).xreplace({x + y: 2})\n",
      " |      x + y + 2\n",
      " |      >>> (x + 2 + exp(x + 2)).xreplace({x + 2: y})\n",
      " |      x + exp(y) + 2\n",
      " |      \n",
      " |      xreplace doesn't differentiate between free and bound symbols. In the\n",
      " |      following, subs(x, y) would not change x since it is a bound symbol,\n",
      " |      but xreplace does:\n",
      " |      \n",
      " |      >>> from sympy import Integral\n",
      " |      >>> Integral(x, (x, 1, 2*x)).xreplace({x: y})\n",
      " |      Integral(y, (y, 1, 2*y))\n",
      " |      \n",
      " |      Trying to replace x with an expression raises an error:\n",
      " |      \n",
      " |      >>> Integral(x, (x, 1, 2*x)).xreplace({x: 2*y}) # doctest: +SKIP\n",
      " |      ValueError: Invalid limits given: ((2*y, 1, 4*y),)\n",
      " |      \n",
      " |      See Also\n",
      " |      ========\n",
      " |      replace: replacement capable of doing wildcard-like matching,\n",
      " |               parsing of match, and conditional replacements\n",
      " |      subs: substitution of subexpressions as defined by the objects\n",
      " |            themselves.\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Class methods inherited from sympy.core.basic.Basic:\n",
      " |  \n",
      " |  fromiter(args, **assumptions) from sympy.core.function.FunctionClass\n",
      " |      Create a new object from an iterable.\n",
      " |      \n",
      " |      This is a convenience function that allows one to create objects from\n",
      " |      any iterable, without having to convert to a list or tuple first.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Tuple\n",
      " |      >>> Tuple.fromiter(i for i in range(5))\n",
      " |      (0, 1, 2, 3, 4)\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data descriptors inherited from sympy.core.basic.Basic:\n",
      " |  \n",
      " |  args\n",
      " |      Returns a tuple of arguments of 'self'.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import cot\n",
      " |      >>> from sympy.abc import x, y\n",
      " |      \n",
      " |      >>> cot(x).args\n",
      " |      (x,)\n",
      " |      \n",
      " |      >>> cot(x).args[0]\n",
      " |      x\n",
      " |      \n",
      " |      >>> (x*y).args\n",
      " |      (x, y)\n",
      " |      \n",
      " |      >>> (x*y).args[1]\n",
      " |      y\n",
      " |      \n",
      " |      Notes\n",
      " |      =====\n",
      " |      \n",
      " |      Never use self._args, always use self.args.\n",
      " |      Only use _args in __new__ when creating a new function.\n",
      " |      Don't override .args() from Basic (so that it's easy to\n",
      " |      change the interface in the future if needed).\n",
      " |  \n",
      " |  assumptions0\n",
      " |      Return object `type` assumptions.\n",
      " |      \n",
      " |      For example:\n",
      " |      \n",
      " |        Symbol('x', real=True)\n",
      " |        Symbol('x', integer=True)\n",
      " |      \n",
      " |      are different objects. In other words, besides Python type (Symbol in\n",
      " |      this case), the initial assumptions are also forming their typeinfo.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Symbol\n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> x.assumptions0\n",
      " |      {'commutative': True}\n",
      " |      >>> x = Symbol(\"x\", positive=True)\n",
      " |      >>> x.assumptions0\n",
      " |      {'commutative': True, 'complex': True, 'hermitian': True,\n",
      " |      'imaginary': False, 'negative': False, 'nonnegative': True,\n",
      " |      'nonpositive': False, 'nonzero': True, 'positive': True, 'real': True,\n",
      " |      'zero': False}\n",
      " |  \n",
      " |  canonical_variables\n",
      " |      Return a dictionary mapping any variable defined in\n",
      " |      ``self.variables`` as underscore-suffixed numbers\n",
      " |      corresponding to their position in ``self.variables``. Enough\n",
      " |      underscores are added to ensure that there will be no clash with\n",
      " |      existing free symbols.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import Lambda\n",
      " |      >>> from sympy.abc import x\n",
      " |      >>> Lambda(x, 2*x).canonical_variables\n",
      " |      {x: 0_}\n",
      " |  \n",
      " |  free_symbols\n",
      " |      Return from the atoms of self those which are free symbols.\n",
      " |      \n",
      " |      For most expressions, all symbols are free symbols. For some classes\n",
      " |      this is not true. e.g. Integrals use Symbols for the dummy variables\n",
      " |      which are bound variables, so Integral has a method to return all\n",
      " |      symbols except those. Derivative keeps track of symbols with respect\n",
      " |      to which it will perform a derivative; those are\n",
      " |      bound variables, too, so it has its own free_symbols method.\n",
      " |      \n",
      " |      Any other method that uses bound variables should implement a\n",
      " |      free_symbols method.\n",
      " |  \n",
      " |  is_algebraic\n",
      " |  \n",
      " |  is_antihermitian\n",
      " |  \n",
      " |  is_comparable\n",
      " |      Return True if self can be computed to a real number\n",
      " |      (or already is a real number) with precision, else False.\n",
      " |      \n",
      " |      Examples\n",
      " |      ========\n",
      " |      \n",
      " |      >>> from sympy import exp_polar, pi, I\n",
      " |      >>> (I*exp_polar(I*pi/2)).is_comparable\n",
      " |      True\n",
      " |      >>> (I*exp_polar(I*pi*2)).is_comparable\n",
      " |      False\n",
      " |      \n",
      " |      A False result does not mean that `self` cannot be rewritten\n",
      " |      into a form that would be comparable. For example, the\n",
      " |      difference computed below is zero but without simplification\n",
      " |      it does not evaluate to a zero with precision:\n",
      " |      \n",
      " |      >>> e = 2**pi*(1 + 2**pi)\n",
      " |      >>> dif = e - e.expand()\n",
      " |      >>> dif.is_comparable\n",
      " |      False\n",
      " |      >>> dif.n(2)._prec\n",
      " |      1\n",
      " |  \n",
      " |  is_complex\n",
      " |  \n",
      " |  is_composite\n",
      " |  \n",
      " |  is_even\n",
      " |  \n",
      " |  is_finite\n",
      " |  \n",
      " |  is_hermitian\n",
      " |  \n",
      " |  is_imaginary\n",
      " |  \n",
      " |  is_infinite\n",
      " |  \n",
      " |  is_integer\n",
      " |  \n",
      " |  is_irrational\n",
      " |  \n",
      " |  is_negative\n",
      " |  \n",
      " |  is_noninteger\n",
      " |  \n",
      " |  is_nonnegative\n",
      " |  \n",
      " |  is_nonpositive\n",
      " |  \n",
      " |  is_nonzero\n",
      " |  \n",
      " |  is_odd\n",
      " |  \n",
      " |  is_polar\n",
      " |  \n",
      " |  is_positive\n",
      " |  \n",
      " |  is_prime\n",
      " |  \n",
      " |  is_rational\n",
      " |  \n",
      " |  is_real\n",
      " |  \n",
      " |  is_transcendental\n",
      " |  \n",
      " |  is_zero\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Data and other attributes inherited from sympy.core.basic.Basic:\n",
      " |  \n",
      " |  is_Add = False\n",
      " |  \n",
      " |  is_AlgebraicNumber = False\n",
      " |  \n",
      " |  is_Atom = False\n",
      " |  \n",
      " |  is_Boolean = False\n",
      " |  \n",
      " |  is_Derivative = False\n",
      " |  \n",
      " |  is_Dummy = False\n",
      " |  \n",
      " |  is_Equality = False\n",
      " |  \n",
      " |  is_Float = False\n",
      " |  \n",
      " |  is_Indexed = False\n",
      " |  \n",
      " |  is_Integer = False\n",
      " |  \n",
      " |  is_Matrix = False\n",
      " |  \n",
      " |  is_Mul = False\n",
      " |  \n",
      " |  is_Not = False\n",
      " |  \n",
      " |  is_Number = False\n",
      " |  \n",
      " |  is_NumberSymbol = False\n",
      " |  \n",
      " |  is_Order = False\n",
      " |  \n",
      " |  is_Piecewise = False\n",
      " |  \n",
      " |  is_Point = False\n",
      " |  \n",
      " |  is_Poly = False\n",
      " |  \n",
      " |  is_Pow = False\n",
      " |  \n",
      " |  is_Rational = False\n",
      " |  \n",
      " |  is_Relational = False\n",
      " |  \n",
      " |  is_Symbol = False\n",
      " |  \n",
      " |  is_Vector = False\n",
      " |  \n",
      " |  is_Wild = False\n",
      " |  \n",
      " |  is_symbol = False\n",
      " |  \n",
      " |  ----------------------------------------------------------------------\n",
      " |  Methods inherited from sympy.core.evalf.EvalfMixin:\n",
      " |  \n",
      " |  evalf(self, n=15, subs=None, maxn=100, chop=False, strict=False, quad=None, verbose=False)\n",
      " |      Evaluate the given formula to an accuracy of n digits.\n",
      " |      Optional keyword arguments:\n",
      " |      \n",
      " |          subs=<dict>\n",
      " |              Substitute numerical values for symbols, e.g.\n",
      " |              subs={x:3, y:1+pi}. The substitutions must be given as a\n",
      " |              dictionary.\n",
      " |      \n",
      " |          maxn=<integer>\n",
      " |              Allow a maximum temporary working precision of maxn digits\n",
      " |              (default=100)\n",
      " |      \n",
      " |          chop=<bool>\n",
      " |              Replace tiny real or imaginary parts in subresults\n",
      " |              by exact zeros (default=False)\n",
      " |      \n",
      " |          strict=<bool>\n",
      " |              Raise PrecisionExhausted if any subresult fails to evaluate\n",
      " |              to full accuracy, given the available maxprec\n",
      " |              (default=False)\n",
      " |      \n",
      " |          quad=<str>\n",
      " |              Choose algorithm for numerical quadrature. By default,\n",
      " |              tanh-sinh quadrature is used. For oscillatory\n",
      " |              integrals on an infinite interval, try quad='osc'.\n",
      " |      \n",
      " |          verbose=<bool>\n",
      " |              Print debug information (default=False)\n",
      " |  \n",
      " |  n = evalf(self, n=15, subs=None, maxn=100, chop=False, strict=False, quad=None, verbose=False)\n",
      " |      Evaluate the given formula to an accuracy of n digits.\n",
      " |      Optional keyword arguments:\n",
      " |      \n",
      " |          subs=<dict>\n",
      " |              Substitute numerical values for symbols, e.g.\n",
      " |              subs={x:3, y:1+pi}. The substitutions must be given as a\n",
      " |              dictionary.\n",
      " |      \n",
      " |          maxn=<integer>\n",
      " |              Allow a maximum temporary working precision of maxn digits\n",
      " |              (default=100)\n",
      " |      \n",
      " |          chop=<bool>\n",
      " |              Replace tiny real or imaginary parts in subresults\n",
      " |              by exact zeros (default=False)\n",
      " |      \n",
      " |          strict=<bool>\n",
      " |              Raise PrecisionExhausted if any subresult fails to evaluate\n",
      " |              to full accuracy, given the available maxprec\n",
      " |              (default=False)\n",
      " |      \n",
      " |          quad=<str>\n",
      " |              Choose algorithm for numerical quadrature. By default,\n",
      " |              tanh-sinh quadrature is used. For oscillatory\n",
      " |              integrals on an infinite interval, try quad='osc'.\n",
      " |      \n",
      " |          verbose=<bool>\n",
      " |              Print debug information (default=False)\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(frac)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'Abs': Abs,\n",
       " 'AccumBounds': sympy.calculus.util.AccumulationBounds,\n",
       " 'Add': sympy.core.add.Add,\n",
       " 'Adjoint': sympy.matrices.expressions.adjoint.Adjoint,\n",
       " 'AlgebraicField': sympy.polys.domains.algebraicfield.AlgebraicField,\n",
       " 'AlgebraicNumber': sympy.core.numbers.AlgebraicNumber,\n",
       " 'And': And,\n",
       " 'AppliedPredicate': sympy.assumptions.assume.AppliedPredicate,\n",
       " 'Array': sympy.tensor.array.dense_ndim_array.ImmutableDenseNDimArray,\n",
       " 'AssumptionsContext': sympy.assumptions.assume.AssumptionsContext,\n",
       " 'Atom': sympy.core.basic.Atom,\n",
       " 'AtomicExpr': sympy.core.expr.AtomicExpr,\n",
       " 'BasePolynomialError': sympy.polys.polyerrors.BasePolynomialError,\n",
       " 'Basic': sympy.core.basic.Basic,\n",
       " 'BlockDiagMatrix': sympy.matrices.expressions.blockmatrix.BlockDiagMatrix,\n",
       " 'BlockMatrix': sympy.matrices.expressions.blockmatrix.BlockMatrix,\n",
       " 'C': <sympy.deprecated.class_registry.ClassRegistry at 0x4b36808>,\n",
       " 'C0': C_{0},\n",
       " 'CC': CC,\n",
       " 'CRootOf': sympy.polys.rootoftools.ComplexRootOf,\n",
       " 'Catalan': Catalan,\n",
       " 'Chi': Chi,\n",
       " 'Ci': Ci,\n",
       " 'Circle': sympy.geometry.ellipse.Circle,\n",
       " 'ClassRegistry': sympy.deprecated.class_registry.ClassRegistry,\n",
       " 'CoercionFailed': sympy.polys.polyerrors.CoercionFailed,\n",
       " 'Complement': sympy.sets.sets.Complement,\n",
       " 'ComplexField': sympy.polys.domains.complexfield.ComplexField,\n",
       " 'ComplexRegion': sympy.sets.fancysets.ComplexRegion,\n",
       " 'ComplexRootOf': sympy.polys.rootoftools.ComplexRootOf,\n",
       " 'ComputationFailed': sympy.polys.polyerrors.ComputationFailed,\n",
       " 'ConditionSet': sympy.sets.conditionset.ConditionSet,\n",
       " 'Contains': Contains,\n",
       " 'CosineTransform': CosineTransform,\n",
       " 'Curve': sympy.geometry.curve.Curve,\n",
       " 'DeferredVector': sympy.matrices.matrices.DeferredVector,\n",
       " 'DenseNDimArray': sympy.tensor.array.dense_ndim_array.DenseNDimArray,\n",
       " 'Derivative': sympy.core.function.Derivative,\n",
       " 'Determinant': sympy.matrices.expressions.determinant.Determinant,\n",
       " 'DiagonalMatrix': sympy.matrices.expressions.diagonal.DiagonalMatrix,\n",
       " 'DiagonalOf': sympy.matrices.expressions.diagonal.DiagonalOf,\n",
       " 'Dict': sympy.core.containers.Dict,\n",
       " 'DiracDelta': DiracDelta,\n",
       " 'Domain': sympy.polys.domains.domain.Domain,\n",
       " 'DomainError': sympy.polys.polyerrors.DomainError,\n",
       " 'DotProduct': sympy.matrices.expressions.dotproduct.DotProduct,\n",
       " 'Dummy': sympy.core.symbol.Dummy,\n",
       " 'E': E,\n",
       " 'E1': <function sympy.functions.special.error_functions.E1>,\n",
       " 'EPath': sympy.simplify.epathtools.EPath,\n",
       " 'EX': EX,\n",
       " 'Ei': Ei,\n",
       " 'Eijk': <function sympy.functions.special.tensor_functions.Eijk>,\n",
       " 'Ellipse': sympy.geometry.ellipse.Ellipse,\n",
       " 'EmptySequence': sympy.series.sequences.EmptySequence,\n",
       " 'EmptySet': sympy.sets.sets.EmptySet,\n",
       " 'Eq': sympy.core.relational.Equality,\n",
       " 'Equality': sympy.core.relational.Equality,\n",
       " 'Equivalent': Equivalent,\n",
       " 'EulerGamma': EulerGamma,\n",
       " 'EvaluationFailed': sympy.polys.polyerrors.EvaluationFailed,\n",
       " 'ExactQuotientFailed': sympy.polys.polyerrors.ExactQuotientFailed,\n",
       " 'Expr': sympy.core.expr.Expr,\n",
       " 'ExpressionDomain': sympy.polys.domains.expressiondomain.ExpressionDomain,\n",
       " 'ExtraneousFactors': sympy.polys.polyerrors.ExtraneousFactors,\n",
       " 'FF': sympy.polys.domains.pythonfinitefield.PythonFiniteField,\n",
       " 'FF_gmpy': sympy.polys.domains.gmpyfinitefield.GMPYFiniteField,\n",
       " 'FF_python': sympy.polys.domains.pythonfinitefield.PythonFiniteField,\n",
       " 'FU': {'L': <function sympy.simplify.fu.L>,\n",
       "  'TR0': <function sympy.simplify.fu.TR0>,\n",
       "  'TR1': <function sympy.simplify.fu.TR1>,\n",
       "  'TR10': <function sympy.simplify.fu.TR10>,\n",
       "  'TR10i': <function sympy.simplify.fu.TR10i>,\n",
       "  'TR11': <function sympy.simplify.fu.TR11>,\n",
       "  'TR111': <function sympy.simplify.fu.TR111>,\n",
       "  'TR12': <function sympy.simplify.fu.TR12>,\n",
       "  'TR12i': <function sympy.simplify.fu.TR12i>,\n",
       "  'TR13': <function sympy.simplify.fu.TR13>,\n",
       "  'TR14': <function sympy.simplify.fu.TR14>,\n",
       "  'TR15': <function sympy.simplify.fu.TR15>,\n",
       "  'TR16': <function sympy.simplify.fu.TR16>,\n",
       "  'TR2': <function sympy.simplify.fu.TR2>,\n",
       "  'TR22': <function sympy.simplify.fu.TR22>,\n",
       "  'TR2i': <function sympy.simplify.fu.TR2i>,\n",
       "  'TR3': <function sympy.simplify.fu.TR3>,\n",
       "  'TR4': <function sympy.simplify.fu.TR4>,\n",
       "  'TR5': <function sympy.simplify.fu.TR5>,\n",
       "  'TR6': <function sympy.simplify.fu.TR6>,\n",
       "  'TR7': <function sympy.simplify.fu.TR7>,\n",
       "  'TR8': <function sympy.simplify.fu.TR8>,\n",
       "  'TR9': <function sympy.simplify.fu.TR9>,\n",
       "  'TRmorrie': <function sympy.simplify.fu.TRmorrie>},\n",
       " 'FallingFactorial': FallingFactorial,\n",
       " 'FiniteField': sympy.polys.domains.finitefield.FiniteField,\n",
       " 'FiniteSet': sympy.sets.sets.FiniteSet,\n",
       " 'FlagError': sympy.polys.polyerrors.FlagError,\n",
       " 'Float': sympy.core.numbers.Float,\n",
       " 'FourierTransform': FourierTransform,\n",
       " 'FractionField': sympy.polys.domains.fractionfield.FractionField,\n",
       " 'Function': Function,\n",
       " 'FunctionClass': sympy.core.function.FunctionClass,\n",
       " 'FunctionMatrix': sympy.matrices.expressions.funcmatrix.FunctionMatrix,\n",
       " 'GF': sympy.polys.domains.pythonfinitefield.PythonFiniteField,\n",
       " 'GMPYFiniteField': sympy.polys.domains.gmpyfinitefield.GMPYFiniteField,\n",
       " 'GMPYIntegerRing': sympy.polys.domains.gmpyintegerring.GMPYIntegerRing,\n",
       " 'GMPYRationalField': sympy.polys.domains.gmpyrationalfield.GMPYRationalField,\n",
       " 'Ge': sympy.core.relational.GreaterThan,\n",
       " 'GeneratorsError': sympy.polys.polyerrors.GeneratorsError,\n",
       " 'GeneratorsNeeded': sympy.polys.polyerrors.GeneratorsNeeded,\n",
       " 'GeometryError': sympy.geometry.exceptions.GeometryError,\n",
       " 'GoldenRatio': GoldenRatio,\n",
       " 'GramSchmidt': <function sympy.matrices.dense.GramSchmidt>,\n",
       " 'GreaterThan': sympy.core.relational.GreaterThan,\n",
       " 'GroebnerBasis': sympy.polys.polytools.GroebnerBasis,\n",
       " 'Gt': sympy.core.relational.StrictGreaterThan,\n",
       " 'HadamardProduct': sympy.matrices.expressions.hadamard.HadamardProduct,\n",
       " 'HankelTransform': HankelTransform,\n",
       " 'Heaviside': Heaviside,\n",
       " 'HeuristicGCDFailed': sympy.polys.polyerrors.HeuristicGCDFailed,\n",
       " 'HomomorphismFailed': sympy.polys.polyerrors.HomomorphismFailed,\n",
       " 'I': I,\n",
       " 'ITE': ITE,\n",
       " 'Id': Lambda(_x, _x),\n",
       " 'Identity': sympy.matrices.expressions.matexpr.Identity,\n",
       " 'Idx': sympy.tensor.indexed.Idx,\n",
       " 'ImageSet': sympy.sets.fancysets.ImageSet,\n",
       " 'ImmutableDenseMatrix': sympy.matrices.immutable.ImmutableDenseMatrix,\n",
       " 'ImmutableDenseNDimArray': sympy.tensor.array.dense_ndim_array.ImmutableDenseNDimArray,\n",
       " 'ImmutableMatrix': sympy.matrices.immutable.ImmutableDenseMatrix,\n",
       " 'ImmutableSparseMatrix': sympy.matrices.immutable.ImmutableSparseMatrix,\n",
       " 'ImmutableSparseNDimArray': sympy.tensor.array.sparse_ndim_array.ImmutableSparseNDimArray,\n",
       " 'Implies': Implies,\n",
       " 'In': ['',\n",
       "  \"from sympy import *\\ninit_printing()\\nx=Symbol('x')\\nprint(latex(Integral(x**2)))\\nIntegral(x**2)\",\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}^{+}')\\nlatex(mu**2)\\nmu\",\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}^{+}')\\nprint(latex(mu**2))\\nmu\",\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}')\\nprint(latex(mu**2))\\nmu\",\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}^{+}')\\nex1=mu**2\\nprint(latex(ex))\\nex\",\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}^{+}')\\nex1=mu**2\\nprint(latex(ex1))\\nex1\",\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}')\\nex1=mu**2\\nprint(latex(ex1))\\nex1\",\n",
       "  'def mpr(ex):\\n    print(latex(ex))\\n    return ex',\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}')\\nex1=mu**2\\nmpr(ex1)\\n#print(latex(ex1))\\n#ex1\",\n",
       "  \"C0=Symbol('C_{0}')\\nex=C0**2\\nmpr(ex)\",\n",
       "  'mpr((Derivative(x)))',\n",
       "  \"b=Function('g')\\nmpr(rsolve(Eq(b(x+1),b(x)+b(x-1))))\",\n",
       "  \"b=Function('g')\\nmpr(rsolve(Eq(b(x+1),b(x)+b(x-1)),b(x)))\",\n",
       "  \"f=Function('f')(x)\\nex=dsolve(Eq(f.diff(x,x),f),f)\\nmpr(ex.subs({'C1':1,'C2':2}))\",\n",
       "  \"def mpr(ex):\\n    print('LaTeX Form:',latex(ex))\\n    return ex\",\n",
       "  \"from sympy import *\\ninit_printing()\\nx=Symbol('x')\\nprint(latex(Integral(x**2)))\\nIntegral(x**2)\",\n",
       "  \"def mpr(ex):\\n    print('LaTeX Form:',latex(ex))\\n    return ex\",\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}')\\nex1=mu**2\\nmpr(ex1)\\n#print(latex(ex1))\\n#ex1\",\n",
       "  \"C0=Symbol('C_{0}')\\nex=C0**2\\nmpr(ex)\",\n",
       "  'mpr((Derivative(x)))',\n",
       "  'ex=x**2\\nEq(Derivative(ex),diff(ex))',\n",
       "  'integrate((x**3+3)/(x**2+1))',\n",
       "  \"f=Function('f')(x)\\nex=dsolve(Eq(f.diff(x,x),f),f)\\nmpr(ex.subs({'C1':1,'C2':2}))\",\n",
       "  \"b=Function('g')\\nmpr(rsolve(Eq(b(x+1),b(x)+b(x-1)),b(x)))\",\n",
       "  'help(Eq)',\n",
       "  'locals()'],\n",
       " 'Indexed': sympy.tensor.indexed.Indexed,\n",
       " 'IndexedBase': sympy.tensor.indexed.IndexedBase,\n",
       " 'Integer': sympy.core.numbers.Integer,\n",
       " 'IntegerRing': sympy.polys.domains.integerring.IntegerRing,\n",
       " 'Integral': sympy.integrals.integrals.Integral,\n",
       " 'Intersection': sympy.sets.sets.Intersection,\n",
       " 'Interval': sympy.sets.sets.Interval,\n",
       " 'Inverse': sympy.matrices.expressions.inverse.Inverse,\n",
       " 'InverseCosineTransform': InverseCosineTransform,\n",
       " 'InverseFourierTransform': InverseFourierTransform,\n",
       " 'InverseHankelTransform': InverseHankelTransform,\n",
       " 'InverseLaplaceTransform': InverseLaplaceTransform,\n",
       " 'InverseMellinTransform': InverseMellinTransform,\n",
       " 'InverseSineTransform': InverseSineTransform,\n",
       " 'IsomorphismFailed': sympy.polys.polyerrors.IsomorphismFailed,\n",
       " 'KroneckerDelta': KroneckerDelta,\n",
       " 'LC': <function sympy.polys.polytools.LC>,\n",
       " 'LM': <function sympy.polys.polytools.LM>,\n",
       " 'LT': <function sympy.polys.polytools.LT>,\n",
       " 'Lambda': sympy.core.function.Lambda,\n",
       " 'LambertW': LambertW,\n",
       " 'LaplaceTransform': LaplaceTransform,\n",
       " 'Le': sympy.core.relational.LessThan,\n",
       " 'LessThan': sympy.core.relational.LessThan,\n",
       " 'LeviCivita': LeviCivita,\n",
       " 'Li': Li,\n",
       " 'Limit': sympy.series.limits.Limit,\n",
       " 'Line': sympy.geometry.line.Line,\n",
       " 'Line2D': sympy.geometry.line.Line2D,\n",
       " 'Line3D': sympy.geometry.line.Line3D,\n",
       " 'Lt': sympy.core.relational.StrictLessThan,\n",
       " 'MatAdd': sympy.matrices.expressions.matadd.MatAdd,\n",
       " 'MatMul': sympy.matrices.expressions.matmul.MatMul,\n",
       " 'MatPow': sympy.matrices.expressions.matpow.MatPow,\n",
       " 'Matrix': sympy.matrices.dense.MutableDenseMatrix,\n",
       " 'MatrixBase': sympy.matrices.matrices.MatrixBase,\n",
       " 'MatrixExpr': sympy.matrices.expressions.matexpr.MatrixExpr,\n",
       " 'MatrixSlice': sympy.matrices.expressions.slice.MatrixSlice,\n",
       " 'MatrixSymbol': sympy.matrices.expressions.matexpr.MatrixSymbol,\n",
       " 'Max': Max,\n",
       " 'MellinTransform': MellinTransform,\n",
       " 'Min': Min,\n",
       " 'Mod': Mod,\n",
       " 'Monomial': sympy.polys.monomials.Monomial,\n",
       " 'Mul': sympy.core.mul.Mul,\n",
       " 'MultivariatePolynomialError': sympy.polys.polyerrors.MultivariatePolynomialError,\n",
       " 'MutableDenseMatrix': sympy.matrices.dense.MutableDenseMatrix,\n",
       " 'MutableDenseNDimArray': sympy.tensor.array.dense_ndim_array.MutableDenseNDimArray,\n",
       " 'MutableMatrix': sympy.matrices.dense.MutableDenseMatrix,\n",
       " 'MutableSparseMatrix': sympy.matrices.sparse.MutableSparseMatrix,\n",
       " 'MutableSparseNDimArray': sympy.tensor.array.sparse_ndim_array.MutableSparseNDimArray,\n",
       " 'N': <function sympy.core.evalf.N>,\n",
       " 'NDimArray': sympy.tensor.array.ndim_array.NDimArray,\n",
       " 'Nand': Nand,\n",
       " 'Ne': sympy.core.relational.Unequality,\n",
       " 'NonSquareMatrixError': sympy.matrices.common.NonSquareMatrixError,\n",
       " 'Nor': Nor,\n",
       " 'Not': Not,\n",
       " 'NotAlgebraic': sympy.polys.polyerrors.NotAlgebraic,\n",
       " 'NotInvertible': sympy.polys.polyerrors.NotInvertible,\n",
       " 'NotReversible': sympy.polys.polyerrors.NotReversible,\n",
       " 'Number': sympy.core.numbers.Number,\n",
       " 'NumberSymbol': sympy.core.numbers.NumberSymbol,\n",
       " 'O': sympy.series.order.Order,\n",
       " 'OperationNotSupported': sympy.polys.polyerrors.OperationNotSupported,\n",
       " 'OptionError': sympy.polys.polyerrors.OptionError,\n",
       " 'Options': sympy.polys.polyoptions.Options,\n",
       " 'Or': Or,\n",
       " 'Order': sympy.series.order.Order,\n",
       " 'Out': {1: Integral(x**2, x),\n",
       "  2: \\mu_{0}^{+},\n",
       "  3: \\mu_{0}^{+},\n",
       "  4: \\mu_{0},\n",
       "  6: \\mu_{0}^{+}**2,\n",
       "  7: \\mu_{0}**2,\n",
       "  9: \\mu_{0}**2,\n",
       "  10: C_{0}**2,\n",
       "  11: Derivative(x, x),\n",
       "  13: C0*(1/2 + sqrt(5)/2)**x + C1*(-sqrt(5)/2 + 1/2)**x,\n",
       "  14: Eq(f(x), 2*exp(x) + exp(-x)),\n",
       "  16: Integral(x**2, x),\n",
       "  18: \\mu_{0}**2,\n",
       "  19: C_{0}**2,\n",
       "  20: Derivative(x, x),\n",
       "  21: Eq(Derivative(x**2, x), 2*x),\n",
       "  22: x**2/2 - log(x**2 + 1)/2 + 3*atan(x),\n",
       "  23: Eq(f(x), 2*exp(x) + exp(-x)),\n",
       "  24: C0*(1/2 + sqrt(5)/2)**x + C1*(-sqrt(5)/2 + 1/2)**x},\n",
       " 'POSform': <function sympy.logic.boolalg.POSform>,\n",
       " 'Parabola': sympy.geometry.parabola.Parabola,\n",
       " 'Piecewise': Piecewise,\n",
       " 'Plane': sympy.geometry.plane.Plane,\n",
       " 'Point': sympy.geometry.point.Point,\n",
       " 'Point2D': sympy.geometry.point.Point2D,\n",
       " 'Point3D': sympy.geometry.point.Point3D,\n",
       " 'PoleError': sympy.core.function.PoleError,\n",
       " 'PolificationFailed': sympy.polys.polyerrors.PolificationFailed,\n",
       " 'Poly': sympy.polys.polytools.Poly,\n",
       " 'Polygon': sympy.geometry.polygon.Polygon,\n",
       " 'PolynomialDivisionFailed': sympy.polys.polyerrors.PolynomialDivisionFailed,\n",
       " 'PolynomialError': sympy.polys.polyerrors.PolynomialError,\n",
       " 'PolynomialRing': sympy.polys.domains.polynomialring.PolynomialRing,\n",
       " 'Pow': sympy.core.power.Pow,\n",
       " 'PrecisionExhausted': sympy.core.evalf.PrecisionExhausted,\n",
       " 'Predicate': sympy.assumptions.assume.Predicate,\n",
       " 'Product': sympy.concrete.products.Product,\n",
       " 'ProductSet': sympy.sets.sets.ProductSet,\n",
       " 'PurePoly': sympy.polys.polytools.PurePoly,\n",
       " 'PythonFiniteField': sympy.polys.domains.pythonfinitefield.PythonFiniteField,\n",
       " 'PythonIntegerRing': sympy.polys.domains.pythonintegerring.PythonIntegerRing,\n",
       " 'PythonRationalField': sympy.polys.domains.pythonrationalfield.PythonRationalField,\n",
       " 'Q': <sympy.assumptions.ask.AssumptionKeys at 0x3c41550>,\n",
       " 'QQ': QQ,\n",
       " 'QQ_gmpy': sympy.polys.domains.gmpyrationalfield.GMPYRationalField,\n",
       " 'QQ_python': sympy.polys.domains.pythonrationalfield.PythonRationalField,\n",
       " 'RR': RR,\n",
       " 'Range': sympy.sets.fancysets.Range,\n",
       " 'Rational': sympy.core.numbers.Rational,\n",
       " 'RationalField': sympy.polys.domains.rationalfield.RationalField,\n",
       " 'Ray': sympy.geometry.line.Ray,\n",
       " 'Ray2D': sympy.geometry.line.Ray2D,\n",
       " 'Ray3D': sympy.geometry.line.Ray3D,\n",
       " 'RealField': sympy.polys.domains.realfield.RealField,\n",
       " 'RealNumber': sympy.core.numbers.Float,\n",
       " 'RefinementFailed': sympy.polys.polyerrors.RefinementFailed,\n",
       " 'RegularPolygon': sympy.geometry.polygon.RegularPolygon,\n",
       " 'Rel': sympy.core.relational.Relational,\n",
       " 'RisingFactorial': RisingFactorial,\n",
       " 'RootOf': sympy.polys.rootoftools.RootOf,\n",
       " 'RootSum': sympy.polys.rootoftools.RootSum,\n",
       " 'S': S,\n",
       " 'SOPform': <function sympy.logic.boolalg.SOPform>,\n",
       " 'SYMPY_DEBUG': False,\n",
       " 'Segment': sympy.geometry.line.Segment,\n",
       " 'Segment2D': sympy.geometry.line.Segment2D,\n",
       " 'Segment3D': sympy.geometry.line.Segment3D,\n",
       " 'SeqAdd': sympy.series.sequences.SeqAdd,\n",
       " 'SeqFormula': sympy.series.sequences.SeqFormula,\n",
       " 'SeqMul': sympy.series.sequences.SeqMul,\n",
       " 'SeqPer': sympy.series.sequences.SeqPer,\n",
       " 'Set': sympy.sets.sets.Set,\n",
       " 'ShapeError': sympy.matrices.common.ShapeError,\n",
       " 'Shi': Shi,\n",
       " 'Si': Si,\n",
       " 'Sieve': sympy.ntheory.generate.Sieve,\n",
       " 'SineTransform': SineTransform,\n",
       " 'SingularityFunction': SingularityFunction,\n",
       " 'SparseMatrix': sympy.matrices.sparse.MutableSparseMatrix,\n",
       " 'SparseNDimArray': sympy.tensor.array.sparse_ndim_array.SparseNDimArray,\n",
       " 'StrictGreaterThan': sympy.core.relational.StrictGreaterThan,\n",
       " 'StrictLessThan': sympy.core.relational.StrictLessThan,\n",
       " 'Subs': sympy.core.function.Subs,\n",
       " 'Sum': sympy.concrete.summations.Sum,\n",
       " 'Symbol': sympy.core.symbol.Symbol,\n",
       " 'SymmetricDifference': sympy.sets.sets.SymmetricDifference,\n",
       " 'SympifyError': sympy.core.sympify.SympifyError,\n",
       " 'TableForm': sympy.printing.tableform.TableForm,\n",
       " 'Trace': sympy.matrices.expressions.trace.Trace,\n",
       " 'Transpose': sympy.matrices.expressions.transpose.Transpose,\n",
       " 'Triangle': sympy.geometry.polygon.Triangle,\n",
       " 'Tuple': sympy.core.containers.Tuple,\n",
       " 'Unequality': sympy.core.relational.Unequality,\n",
       " 'UnevaluatedExpr': sympy.core.expr.UnevaluatedExpr,\n",
       " 'UnificationFailed': sympy.polys.polyerrors.UnificationFailed,\n",
       " 'Union': sympy.sets.sets.Union,\n",
       " 'UnivariatePolynomialError': sympy.polys.polyerrors.UnivariatePolynomialError,\n",
       " 'Wild': sympy.core.symbol.Wild,\n",
       " 'WildFunction': WildFunction,\n",
       " 'Xor': Xor,\n",
       " 'Ynm': Ynm,\n",
       " 'Ynm_c': <function sympy.functions.special.spherical_harmonics.Ynm_c>,\n",
       " 'ZZ': ZZ,\n",
       " 'ZZ_gmpy': sympy.polys.domains.gmpyintegerring.GMPYIntegerRing,\n",
       " 'ZZ_python': sympy.polys.domains.pythonintegerring.PythonIntegerRing,\n",
       " 'ZeroMatrix': sympy.matrices.expressions.matexpr.ZeroMatrix,\n",
       " 'Znm': Znm,\n",
       " '_': C0*(1/2 + sqrt(5)/2)**x + C1*(-sqrt(5)/2 + 1/2)**x,\n",
       " '_1': Integral(x**2, x),\n",
       " '_10': C_{0}**2,\n",
       " '_11': Derivative(x, x),\n",
       " '_13': C0*(1/2 + sqrt(5)/2)**x + C1*(-sqrt(5)/2 + 1/2)**x,\n",
       " '_14': Eq(f(x), 2*exp(x) + exp(-x)),\n",
       " '_16': Integral(x**2, x),\n",
       " '_18': \\mu_{0}**2,\n",
       " '_19': C_{0}**2,\n",
       " '_2': \\mu_{0}^{+},\n",
       " '_20': Derivative(x, x),\n",
       " '_21': Eq(Derivative(x**2, x), 2*x),\n",
       " '_22': x**2/2 - log(x**2 + 1)/2 + 3*atan(x),\n",
       " '_23': Eq(f(x), 2*exp(x) + exp(-x)),\n",
       " '_24': C0*(1/2 + sqrt(5)/2)**x + C1*(-sqrt(5)/2 + 1/2)**x,\n",
       " '_3': \\mu_{0}^{+},\n",
       " '_4': \\mu_{0},\n",
       " '_6': \\mu_{0}^{+}**2,\n",
       " '_7': \\mu_{0}**2,\n",
       " '_9': \\mu_{0}**2,\n",
       " '__': Eq(f(x), 2*exp(x) + exp(-x)),\n",
       " '___': x**2/2 - log(x**2 + 1)/2 + 3*atan(x),\n",
       " '__builtin__': <module 'builtins' (built-in)>,\n",
       " '__builtins__': <module 'builtins' (built-in)>,\n",
       " '__doc__': 'Automatically created module for IPython interactive environment',\n",
       " '__loader__': None,\n",
       " '__name__': '__main__',\n",
       " '__package__': None,\n",
       " '__spec__': None,\n",
       " '_dh': ['C:\\\\Users\\\\Administrator\\\\Desktop\\\\Scripts\\\\2048S'],\n",
       " '_i': 'help(Eq)',\n",
       " '_i1': \"from sympy import *\\ninit_printing()\\nx=Symbol('x')\\nprint(latex(Integral(x**2)))\\nIntegral(x**2)\",\n",
       " '_i10': \"C0=Symbol('C_{0}')\\nex=C0**2\\nmpr(ex)\",\n",
       " '_i11': 'mpr((Derivative(x)))',\n",
       " '_i12': \"b=Function('g')\\nmpr(rsolve(Eq(b(x+1),b(x)+b(x-1))))\",\n",
       " '_i13': \"b=Function('g')\\nmpr(rsolve(Eq(b(x+1),b(x)+b(x-1)),b(x)))\",\n",
       " '_i14': \"f=Function('f')(x)\\nex=dsolve(Eq(f.diff(x,x),f),f)\\nmpr(ex.subs({'C1':1,'C2':2}))\",\n",
       " '_i15': \"def mpr(ex):\\n    print('LaTeX Form:',latex(ex))\\n    return ex\",\n",
       " '_i16': \"from sympy import *\\ninit_printing()\\nx=Symbol('x')\\nprint(latex(Integral(x**2)))\\nIntegral(x**2)\",\n",
       " '_i17': \"def mpr(ex):\\n    print('LaTeX Form:',latex(ex))\\n    return ex\",\n",
       " '_i18': \"mu=Symbol('\\\\\\\\mu_{0}')\\nex1=mu**2\\nmpr(ex1)\\n#print(latex(ex1))\\n#ex1\",\n",
       " '_i19': \"C0=Symbol('C_{0}')\\nex=C0**2\\nmpr(ex)\",\n",
       " '_i2': \"mu=Symbol('\\\\\\\\mu_{0}^{+}')\\nlatex(mu**2)\\nmu\",\n",
       " '_i20': 'mpr((Derivative(x)))',\n",
       " '_i21': 'ex=x**2\\nEq(Derivative(ex),diff(ex))',\n",
       " '_i22': 'integrate((x**3+3)/(x**2+1))',\n",
       " '_i23': \"f=Function('f')(x)\\nex=dsolve(Eq(f.diff(x,x),f),f)\\nmpr(ex.subs({'C1':1,'C2':2}))\",\n",
       " '_i24': \"b=Function('g')\\nmpr(rsolve(Eq(b(x+1),b(x)+b(x-1)),b(x)))\",\n",
       " '_i25': 'help(Eq)',\n",
       " '_i26': 'locals()',\n",
       " '_i3': \"mu=Symbol('\\\\\\\\mu_{0}^{+}')\\nprint(latex(mu**2))\\nmu\",\n",
       " '_i4': \"mu=Symbol('\\\\\\\\mu_{0}')\\nprint(latex(mu**2))\\nmu\",\n",
       " '_i5': \"mu=Symbol('\\\\\\\\mu_{0}^{+}')\\nex1=mu**2\\nprint(latex(ex))\\nex\",\n",
       " '_i6': \"mu=Symbol('\\\\\\\\mu_{0}^{+}')\\nex1=mu**2\\nprint(latex(ex1))\\nex1\",\n",
       " '_i7': \"mu=Symbol('\\\\\\\\mu_{0}')\\nex1=mu**2\\nprint(latex(ex1))\\nex1\",\n",
       " '_i8': 'def mpr(ex):\\n    print(latex(ex))\\n    return ex',\n",
       " '_i9': \"mu=Symbol('\\\\\\\\mu_{0}')\\nex1=mu**2\\nmpr(ex1)\\n#print(latex(ex1))\\n#ex1\",\n",
       " '_ih': ['',\n",
       "  \"from sympy import *\\ninit_printing()\\nx=Symbol('x')\\nprint(latex(Integral(x**2)))\\nIntegral(x**2)\",\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}^{+}')\\nlatex(mu**2)\\nmu\",\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}^{+}')\\nprint(latex(mu**2))\\nmu\",\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}')\\nprint(latex(mu**2))\\nmu\",\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}^{+}')\\nex1=mu**2\\nprint(latex(ex))\\nex\",\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}^{+}')\\nex1=mu**2\\nprint(latex(ex1))\\nex1\",\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}')\\nex1=mu**2\\nprint(latex(ex1))\\nex1\",\n",
       "  'def mpr(ex):\\n    print(latex(ex))\\n    return ex',\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}')\\nex1=mu**2\\nmpr(ex1)\\n#print(latex(ex1))\\n#ex1\",\n",
       "  \"C0=Symbol('C_{0}')\\nex=C0**2\\nmpr(ex)\",\n",
       "  'mpr((Derivative(x)))',\n",
       "  \"b=Function('g')\\nmpr(rsolve(Eq(b(x+1),b(x)+b(x-1))))\",\n",
       "  \"b=Function('g')\\nmpr(rsolve(Eq(b(x+1),b(x)+b(x-1)),b(x)))\",\n",
       "  \"f=Function('f')(x)\\nex=dsolve(Eq(f.diff(x,x),f),f)\\nmpr(ex.subs({'C1':1,'C2':2}))\",\n",
       "  \"def mpr(ex):\\n    print('LaTeX Form:',latex(ex))\\n    return ex\",\n",
       "  \"from sympy import *\\ninit_printing()\\nx=Symbol('x')\\nprint(latex(Integral(x**2)))\\nIntegral(x**2)\",\n",
       "  \"def mpr(ex):\\n    print('LaTeX Form:',latex(ex))\\n    return ex\",\n",
       "  \"mu=Symbol('\\\\\\\\mu_{0}')\\nex1=mu**2\\nmpr(ex1)\\n#print(latex(ex1))\\n#ex1\",\n",
       "  \"C0=Symbol('C_{0}')\\nex=C0**2\\nmpr(ex)\",\n",
       "  'mpr((Derivative(x)))',\n",
       "  'ex=x**2\\nEq(Derivative(ex),diff(ex))',\n",
       "  'integrate((x**3+3)/(x**2+1))',\n",
       "  \"f=Function('f')(x)\\nex=dsolve(Eq(f.diff(x,x),f),f)\\nmpr(ex.subs({'C1':1,'C2':2}))\",\n",
       "  \"b=Function('g')\\nmpr(rsolve(Eq(b(x+1),b(x)+b(x-1)),b(x)))\",\n",
       "  'help(Eq)',\n",
       "  'locals()'],\n",
       " '_ii': \"b=Function('g')\\nmpr(rsolve(Eq(b(x+1),b(x)+b(x-1)),b(x)))\",\n",
       " '_iii': \"f=Function('f')(x)\\nex=dsolve(Eq(f.diff(x,x),f),f)\\nmpr(ex.subs({'C1':1,'C2':2}))\",\n",
       " '_oh': {1: Integral(x**2, x),\n",
       "  2: \\mu_{0}^{+},\n",
       "  3: \\mu_{0}^{+},\n",
       "  4: \\mu_{0},\n",
       "  6: \\mu_{0}^{+}**2,\n",
       "  7: \\mu_{0}**2,\n",
       "  9: \\mu_{0}**2,\n",
       "  10: C_{0}**2,\n",
       "  11: Derivative(x, x),\n",
       "  13: C0*(1/2 + sqrt(5)/2)**x + C1*(-sqrt(5)/2 + 1/2)**x,\n",
       "  14: Eq(f(x), 2*exp(x) + exp(-x)),\n",
       "  16: Integral(x**2, x),\n",
       "  18: \\mu_{0}**2,\n",
       "  19: C_{0}**2,\n",
       "  20: Derivative(x, x),\n",
       "  21: Eq(Derivative(x**2, x), 2*x),\n",
       "  22: x**2/2 - log(x**2 + 1)/2 + 3*atan(x),\n",
       "  23: Eq(f(x), 2*exp(x) + exp(-x)),\n",
       "  24: C0*(1/2 + sqrt(5)/2)**x + C1*(-sqrt(5)/2 + 1/2)**x},\n",
       " 'acos': acos,\n",
       " 'acosh': acosh,\n",
       " 'acot': acot,\n",
       " 'acoth': acoth,\n",
       " 'acsc': acsc,\n",
       " 'acsch': acsch,\n",
       " 'add': <module 'sympy.core.add' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\add.py'>,\n",
       " 'adjoint': adjoint,\n",
       " 'airyai': airyai,\n",
       " 'airyaiprime': airyaiprime,\n",
       " 'airybi': airybi,\n",
       " 'airybiprime': airybiprime,\n",
       " 'apart': <function sympy.polys.partfrac.apart>,\n",
       " 'apart_list': <function sympy.polys.partfrac.apart_list>,\n",
       " 'apply_finite_diff': <function sympy.calculus.finite_diff.apply_finite_diff>,\n",
       " 'are_similar': <function sympy.geometry.util.are_similar>,\n",
       " 'arg': arg,\n",
       " 'array': <module 'sympy.tensor.array' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\tensor\\\\array\\\\__init__.py'>,\n",
       " 'as_finite_diff': <function sympy.calculus.finite_diff._as_finite_diff>,\n",
       " 'asec': asec,\n",
       " 'asech': asech,\n",
       " 'asin': asin,\n",
       " 'asinh': asinh,\n",
       " 'ask': <function sympy.assumptions.ask.ask>,\n",
       " 'ask_generated': <module 'sympy.assumptions.ask_generated' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\assumptions\\\\ask_generated.py'>,\n",
       " 'assemble_partfrac_list': <function sympy.polys.partfrac.assemble_partfrac_list>,\n",
       " 'assoc_laguerre': assoc_laguerre,\n",
       " 'assoc_legendre': assoc_legendre,\n",
       " 'assume': <module 'sympy.assumptions.assume' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\assumptions\\\\assume.py'>,\n",
       " 'assuming': <function sympy.assumptions.assume.assuming>,\n",
       " 'assumptions': <module 'sympy.assumptions' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\assumptions\\\\__init__.py'>,\n",
       " 'atan': atan,\n",
       " 'atan2': atan2,\n",
       " 'atanh': atanh,\n",
       " 'b': g,\n",
       " 'basic': <module 'sympy.core.basic' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\basic.py'>,\n",
       " 'bell': bell,\n",
       " 'bernoulli': bernoulli,\n",
       " 'besseli': besseli,\n",
       " 'besselj': besselj,\n",
       " 'besselk': besselk,\n",
       " 'besselsimp': <function sympy.simplify.simplify.besselsimp>,\n",
       " 'bessely': bessely,\n",
       " 'beta': beta,\n",
       " 'binomial': binomial,\n",
       " 'binomial_coefficients': <function sympy.ntheory.multinomial.binomial_coefficients>,\n",
       " 'binomial_coefficients_list': <function sympy.ntheory.multinomial.binomial_coefficients_list>,\n",
       " 'bivariate': <module 'sympy.solvers.bivariate' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\solvers\\\\bivariate.py'>,\n",
       " 'block_collapse': <function sympy.matrices.expressions.blockmatrix.block_collapse>,\n",
       " 'blockcut': <function sympy.matrices.expressions.blockmatrix.blockcut>,\n",
       " 'bool_map': <function sympy.logic.boolalg.bool_map>,\n",
       " 'boolalg': <module 'sympy.logic.boolalg' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\logic\\\\boolalg.py'>,\n",
       " 'bottom_up': <function sympy.simplify.simplify.bottom_up>,\n",
       " 'bspline_basis': <function sympy.functions.special.bsplines.bspline_basis>,\n",
       " 'bspline_basis_set': <function sympy.functions.special.bsplines.bspline_basis_set>,\n",
       " 'cache': <module 'sympy.core.cache' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\cache.py'>,\n",
       " 'cacheit': <function sympy.core.cache.__cacheit.<locals>.func_wrapper>,\n",
       " 'calculus': <module 'sympy.calculus' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\calculus\\\\__init__.py'>,\n",
       " 'cancel': <function sympy.polys.polytools.cancel>,\n",
       " 'capture': <function sympy.utilities.iterables.capture>,\n",
       " 'cartes': itertools.product,\n",
       " 'casoratian': <function sympy.matrices.dense.casoratian>,\n",
       " 'catalan': catalan,\n",
       " 'cbrt': <function sympy.functions.elementary.miscellaneous.cbrt>,\n",
       " 'ccode': <function sympy.printing.ccode.ccode>,\n",
       " 'ceiling': ceiling,\n",
       " 'centroid': <function sympy.geometry.util.centroid>,\n",
       " 'chebyshevt': chebyshevt,\n",
       " 'chebyshevt_poly': <function sympy.polys.orthopolys.chebyshevt_poly>,\n",
       " 'chebyshevt_root': chebyshevt_root,\n",
       " 'chebyshevu': chebyshevu,\n",
       " 'chebyshevu_poly': <function sympy.polys.orthopolys.chebyshevu_poly>,\n",
       " 'chebyshevu_root': chebyshevu_root,\n",
       " 'check_assumptions': <function sympy.solvers.solvers.check_assumptions>,\n",
       " 'checkodesol': <function sympy.solvers.ode.checkodesol>,\n",
       " 'checkpdesol': <function sympy.solvers.pde.checkpdesol>,\n",
       " 'checksol': <function sympy.solvers.solvers.checksol>,\n",
       " 'class_registry': <module 'sympy.deprecated.class_registry' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\deprecated\\\\class_registry.py'>,\n",
       " 'classify_ode': <function sympy.solvers.ode.classify_ode>,\n",
       " 'classify_pde': <function sympy.solvers.pde.classify_pde>,\n",
       " 'closest_points': <function sympy.geometry.util.closest_points>,\n",
       " 'codegen': <module 'sympy.codegen' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\codegen\\\\__init__.py'>,\n",
       " 'cofactors': <function sympy.polys.polytools.cofactors>,\n",
       " 'collect': <function sympy.simplify.radsimp.collect>,\n",
       " 'collect_const': <function sympy.simplify.radsimp.collect_const>,\n",
       " 'combinatorial': <module 'sympy.functions.combinatorial' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\functions\\\\combinatorial\\\\__init__.py'>,\n",
       " 'combsimp': <function sympy.simplify.combsimp.combsimp>,\n",
       " 'common': <module 'sympy.matrices.common' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\matrices\\\\common.py'>,\n",
       " 'comp': <function sympy.core.numbers.comp>,\n",
       " 'compatibility': <module 'sympy.core.compatibility' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\compatibility.py'>,\n",
       " 'compose': <function sympy.polys.polytools.compose>,\n",
       " 'composite': <function sympy.ntheory.generate.composite>,\n",
       " 'compositepi': <function sympy.ntheory.generate.compositepi>,\n",
       " 'concrete': <module 'sympy.concrete' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\concrete\\\\__init__.py'>,\n",
       " 'conditionset': <module 'sympy.sets.conditionset' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\sets\\\\conditionset.py'>,\n",
       " 'conjugate': conjugate,\n",
       " 'construct_domain': <function sympy.polys.constructor.construct_domain>,\n",
       " 'containers': <module 'sympy.core.containers' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\containers.py'>,\n",
       " 'contains': <module 'sympy.sets.contains' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\sets\\\\contains.py'>,\n",
       " 'content': <function sympy.polys.polytools.content>,\n",
       " 'continued_fraction': <module 'sympy.ntheory.continued_fraction' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\ntheory\\\\continued_fraction.py'>,\n",
       " 'continued_fraction_convergents': <function sympy.ntheory.continued_fraction.continued_fraction_convergents>,\n",
       " 'continued_fraction_iterator': <function sympy.ntheory.continued_fraction.continued_fraction_iterator>,\n",
       " 'continued_fraction_periodic': <function sympy.ntheory.continued_fraction.continued_fraction_periodic>,\n",
       " 'continued_fraction_reduce': <function sympy.ntheory.continued_fraction.continued_fraction_reduce>,\n",
       " 'convex_hull': <function sympy.geometry.util.convex_hull>,\n",
       " 'core': <module 'sympy.core.core' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\core.py'>,\n",
       " 'coreerrors': <module 'sympy.core.coreerrors' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\coreerrors.py'>,\n",
       " 'cos': cos,\n",
       " 'cosh': cosh,\n",
       " 'cosine_transform': <function sympy.integrals.transforms.cosine_transform>,\n",
       " 'cot': cot,\n",
       " 'coth': coth,\n",
       " 'count_ops': <function sympy.core.function.count_ops>,\n",
       " 'count_roots': <function sympy.polys.polytools.count_roots>,\n",
       " 'csc': csc,\n",
       " 'csch': csch,\n",
       " 'cse': <function sympy.simplify.cse_main.cse>,\n",
       " 'cse_main': <module 'sympy.simplify.cse_main' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\simplify\\\\cse_main.py'>,\n",
       " 'cse_opts': <module 'sympy.simplify.cse_opts' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\simplify\\\\cse_opts.py'>,\n",
       " 'curve': <module 'sympy.geometry.curve' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\geometry\\\\curve.py'>,\n",
       " 'cycle_length': <function sympy.ntheory.generate.cycle_length>,\n",
       " 'cyclotomic_poly': <function sympy.polys.specialpolys.cyclotomic_poly>,\n",
       " 'decompogen': <function sympy.solvers.decompogen.decompogen>,\n",
       " 'decompose': <function sympy.polys.polytools.decompose>,\n",
       " 'decorator': <module 'sympy.utilities.decorator' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\utilities\\\\decorator.py'>,\n",
       " 'decorators': <module 'sympy.core.decorators' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\decorators.py'>,\n",
       " 'default_sort_key': <function sympy.core.compatibility.default_sort_key>,\n",
       " 'deg': <function sympy.geometry.polygon.deg>,\n",
       " 'degree': <function sympy.polys.polytools.degree>,\n",
       " 'degree_list': <function sympy.polys.polytools.degree_list>,\n",
       " 'denom': <function sympy.simplify.radsimp.denom>,\n",
       " 'dense': <module 'sympy.matrices.dense' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\matrices\\\\dense.py'>,\n",
       " 'deprecated': <module 'sympy.deprecated' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\deprecated\\\\__init__.py'>,\n",
       " 'derive_by_array': <function sympy.tensor.array.arrayop.derive_by_array>,\n",
       " 'det': <function sympy.matrices.expressions.determinant.det>,\n",
       " 'det_quick': <function sympy.solvers.solvers.det_quick>,\n",
       " 'deutils': <module 'sympy.solvers.deutils' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\solvers\\\\deutils.py'>,\n",
       " 'diag': <function sympy.matrices.dense.diag>,\n",
       " 'dict_merge': <function sympy.utilities.iterables.dict_merge>,\n",
       " 'diff': <function sympy.core.function.diff>,\n",
       " 'difference_delta': <function sympy.series.limitseq.difference_delta>,\n",
       " 'differentiate_finite': <function sympy.calculus.finite_diff.differentiate_finite>,\n",
       " 'digamma': <function sympy.functions.special.gamma_functions.digamma>,\n",
       " 'diophantine': <function sympy.solvers.diophantine.diophantine>,\n",
       " 'dirichlet_eta': dirichlet_eta,\n",
       " 'discrete_log': <function sympy.ntheory.residue_ntheory.discrete_log>,\n",
       " 'discriminant': <function sympy.polys.polytools.discriminant>,\n",
       " 'div': <function sympy.polys.polytools.div>,\n",
       " 'divisor_count': <function sympy.ntheory.factor_.divisor_count>,\n",
       " 'divisor_sigma': divisor_sigma,\n",
       " 'divisors': <function sympy.ntheory.factor_.divisors>,\n",
       " 'doctest': <function sympy.utilities.runtests.doctest>,\n",
       " 'dsolve': <function sympy.solvers.ode.dsolve>,\n",
       " 'egyptian_fraction': <function sympy.ntheory.egyptian_fraction.egyptian_fraction>,\n",
       " 'elementary': <module 'sympy.functions.elementary' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\functions\\\\elementary\\\\__init__.py'>,\n",
       " 'ellipse': <module 'sympy.geometry.ellipse' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\geometry\\\\ellipse.py'>,\n",
       " 'elliptic_e': elliptic_e,\n",
       " 'elliptic_f': elliptic_f,\n",
       " 'elliptic_k': elliptic_k,\n",
       " 'elliptic_pi': elliptic_pi,\n",
       " 'entity': <module 'sympy.geometry.entity' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\geometry\\\\entity.py'>,\n",
       " 'enumerative': <module 'sympy.utilities.enumerative' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\utilities\\\\enumerative.py'>,\n",
       " 'epath': <function sympy.simplify.epathtools.epath>,\n",
       " 'epathtools': <module 'sympy.simplify.epathtools' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\simplify\\\\epathtools.py'>,\n",
       " 'erf': erf,\n",
       " 'erf2': erf2,\n",
       " 'erf2inv': erf2inv,\n",
       " 'erfc': erfc,\n",
       " 'erfcinv': erfcinv,\n",
       " 'erfi': erfi,\n",
       " 'erfinv': erfinv,\n",
       " 'euler': euler,\n",
       " 'euler_equations': <function sympy.calculus.euler.euler_equations>,\n",
       " 'evalf': <module 'sympy.core.evalf' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\evalf.py'>,\n",
       " 'evaluate': <function sympy.core.evaluate.evaluate>,\n",
       " 'ex': Eq(f(x), C1*exp(-x) + C2*exp(x)),\n",
       " 'ex1': \\mu_{0}**2,\n",
       " 'exceptions': <module 'sympy.utilities.exceptions' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\utilities\\\\exceptions.py'>,\n",
       " 'exit': <IPython.core.autocall.ZMQExitAutocall at 0x3434170>,\n",
       " 'exp': exp,\n",
       " 'exp_polar': exp_polar,\n",
       " 'expand': <function sympy.core.function.expand>,\n",
       " 'expand_complex': <function sympy.core.function.expand_complex>,\n",
       " 'expand_func': <function sympy.core.function.expand_func>,\n",
       " 'expand_log': <function sympy.core.function.expand_log>,\n",
       " 'expand_mul': <function sympy.core.function.expand_mul>,\n",
       " 'expand_multinomial': <function sympy.core.function.expand_multinomial>,\n",
       " 'expand_power_base': <function sympy.core.function.expand_power_base>,\n",
       " 'expand_power_exp': <function sympy.core.function.expand_power_exp>,\n",
       " 'expand_trig': <function sympy.core.function.expand_trig>,\n",
       " 'expint': expint,\n",
       " 'expr': <module 'sympy.core.expr' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\expr.py'>,\n",
       " 'expr_with_intlimits': <module 'sympy.concrete.expr_with_intlimits' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\concrete\\\\expr_with_intlimits.py'>,\n",
       " 'expr_with_limits': <module 'sympy.concrete.expr_with_limits' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\concrete\\\\expr_with_limits.py'>,\n",
       " 'expressions': <module 'sympy.matrices.expressions' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\matrices\\\\expressions\\\\__init__.py'>,\n",
       " 'exprtools': <module 'sympy.core.exprtools' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\exprtools.py'>,\n",
       " 'exptrigsimp': <function sympy.simplify.trigsimp.exptrigsimp>,\n",
       " 'exquo': <function sympy.polys.polytools.exquo>,\n",
       " 'external': <module 'sympy.external' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\external\\\\__init__.py'>,\n",
       " 'eye': <function sympy.matrices.dense.eye>,\n",
       " 'f': f(x),\n",
       " 'factor': <function sympy.polys.polytools.factor>,\n",
       " 'factor_': <module 'sympy.ntheory.factor_' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\ntheory\\\\factor_.py'>,\n",
       " 'factor_list': <function sympy.polys.polytools.factor_list>,\n",
       " 'factor_nc': <function sympy.core.exprtools.factor_nc>,\n",
       " 'factor_terms': <function sympy.core.exprtools.factor_terms>,\n",
       " 'factorial': factorial,\n",
       " 'factorial2': factorial2,\n",
       " 'factorint': <function sympy.ntheory.factor_.factorint>,\n",
       " 'factorrat': <function sympy.ntheory.factor_.factorrat>,\n",
       " 'facts': <module 'sympy.core.facts' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\facts.py'>,\n",
       " 'false': False,\n",
       " 'fancysets': <module 'sympy.sets.fancysets' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\sets\\\\fancysets.py'>,\n",
       " 'farthest_points': <function sympy.geometry.util.farthest_points>,\n",
       " 'fcode': <function sympy.printing.fcode.fcode>,\n",
       " 'ff': FallingFactorial,\n",
       " 'fibonacci': fibonacci,\n",
       " 'field': <function sympy.polys.fields.field>,\n",
       " 'field_isomorphism': <function sympy.polys.numberfields.field_isomorphism>,\n",
       " 'filldedent': <function sympy.utilities.misc.filldedent>,\n",
       " 'finite_diff_weights': <function sympy.calculus.finite_diff.finite_diff_weights>,\n",
       " 'flatten': <function sympy.utilities.iterables.flatten>,\n",
       " 'floor': floor,\n",
       " 'fourier_series': <function sympy.series.fourier.fourier_series>,\n",
       " 'fourier_transform': <function sympy.integrals.transforms.fourier_transform>,\n",
       " 'fps': <function sympy.series.formal.fps>,\n",
       " 'frac': frac,\n",
       " 'fraction': <function sympy.simplify.radsimp.fraction>,\n",
       " 'fresnelc': fresnelc,\n",
       " 'fresnels': fresnels,\n",
       " 'fu': <function sympy.simplify.fu.fu>,\n",
       " 'function': <module 'sympy.core.function' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\function.py'>,\n",
       " 'functions': <module 'sympy.functions' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\functions\\\\__init__.py'>,\n",
       " 'gamma': gamma,\n",
       " 'gcd': <function sympy.polys.polytools.gcd>,\n",
       " 'gcd_list': <function sympy.polys.polytools.gcd_list>,\n",
       " 'gcd_terms': <function sympy.core.exprtools.gcd_terms>,\n",
       " 'gcdex': <function sympy.polys.polytools.gcdex>,\n",
       " 'gegenbauer': gegenbauer,\n",
       " 'generate': <module 'sympy.ntheory.generate' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\ntheory\\\\generate.py'>,\n",
       " 'genocchi': genocchi,\n",
       " 'geometry': <module 'sympy.geometry' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\geometry\\\\__init__.py'>,\n",
       " 'get_contraction_structure': <function sympy.tensor.index_methods.get_contraction_structure>,\n",
       " 'get_indices': <function sympy.tensor.index_methods.get_indices>,\n",
       " 'get_ipython': <bound method InteractiveShell.get_ipython of <ipykernel.zmqshell.ZMQInteractiveShell object at 0x032E6210>>,\n",
       " 'gff': <function sympy.polys.polytools.gff>,\n",
       " 'gff_list': <function sympy.polys.polytools.gff_list>,\n",
       " 'gosper': <module 'sympy.concrete.gosper' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\concrete\\\\gosper.py'>,\n",
       " 'grevlex': ReversedGradedLexOrder(),\n",
       " 'grlex': GradedLexOrder(),\n",
       " 'groebner': <function sympy.polys.polytools.groebner>,\n",
       " 'ground_roots': <function sympy.polys.polytools.ground_roots>,\n",
       " 'group': <function sympy.utilities.iterables.group>,\n",
       " 'gruntz': <function sympy.series.gruntz.gruntz>,\n",
       " 'hadamard_product': <function sympy.matrices.expressions.hadamard.hadamard_product>,\n",
       " 'half_gcdex': <function sympy.polys.polytools.half_gcdex>,\n",
       " 'hankel1': hankel1,\n",
       " 'hankel2': hankel2,\n",
       " 'hankel_transform': <function sympy.integrals.transforms.hankel_transform>,\n",
       " 'harmonic': harmonic,\n",
       " 'has_dups': <function sympy.utilities.iterables.has_dups>,\n",
       " 'has_variety': <function sympy.utilities.iterables.has_variety>,\n",
       " 'hermite': hermite,\n",
       " 'hermite_poly': <function sympy.polys.orthopolys.hermite_poly>,\n",
       " 'hessian': <function sympy.matrices.dense.hessian>,\n",
       " 'hn1': hn1,\n",
       " 'hn2': hn2,\n",
       " 'homogeneous_order': <function sympy.solvers.ode.homogeneous_order>,\n",
       " 'horner': <function sympy.polys.polyfuncs.horner>,\n",
       " 'hyper': hyper,\n",
       " 'hyperexpand': <function sympy.simplify.hyperexpand.hyperexpand>,\n",
       " 'hypersimilar': <function sympy.simplify.simplify.hypersimilar>,\n",
       " 'hypersimp': <function sympy.simplify.simplify.hypersimp>,\n",
       " 'idiff': <function sympy.geometry.util.idiff>,\n",
       " 'igcd': <function sympy.core.numbers.igcd>,\n",
       " 'igrevlex': InverseOrder(),\n",
       " 'igrlex': InverseOrder(),\n",
       " 'ilcm': <function sympy.core.numbers.ilcm>,\n",
       " 'ilex': InverseOrder(),\n",
       " 'im': im,\n",
       " 'imageset': <function sympy.sets.sets.imageset>,\n",
       " 'immutable': <module 'sympy.matrices.immutable' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\matrices\\\\immutable.py'>,\n",
       " 'index_methods': <module 'sympy.tensor.index_methods' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\tensor\\\\index_methods.py'>,\n",
       " 'indexed': <module 'sympy.tensor.indexed' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\tensor\\\\indexed.py'>,\n",
       " 'inequalities': <module 'sympy.solvers.inequalities' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\solvers\\\\inequalities.py'>,\n",
       " 'inference': <module 'sympy.logic.inference' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\logic\\\\inference.py'>,\n",
       " 'init_printing': <function sympy.interactive.printing.init_printing>,\n",
       " 'init_session': <function sympy.interactive.session.init_session>,\n",
       " 'integer_nthroot': <function sympy.core.power.integer_nthroot>,\n",
       " 'integrals': <module 'sympy.integrals.integrals' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\integrals\\\\integrals.py'>,\n",
       " 'integrate': <function sympy.integrals.integrals.integrate>,\n",
       " 'interactive': <module 'sympy.interactive' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\interactive\\\\__init__.py'>,\n",
       " 'interactive_traversal': <function sympy.utilities.iterables.interactive_traversal>,\n",
       " 'interpolate': <function sympy.polys.polyfuncs.interpolate>,\n",
       " 'interpolating_poly': <function sympy.polys.specialpolys.interpolating_poly>,\n",
       " 'intersection': <function sympy.geometry.util.intersection>,\n",
       " 'intervals': <function sympy.polys.polytools.intervals>,\n",
       " 'inv_quick': <function sympy.solvers.solvers.inv_quick>,\n",
       " 'inverse_cosine_transform': <function sympy.integrals.transforms.inverse_cosine_transform>,\n",
       " 'inverse_fourier_transform': <function sympy.integrals.transforms.inverse_fourier_transform>,\n",
       " 'inverse_hankel_transform': <function sympy.integrals.transforms.inverse_hankel_transform>,\n",
       " 'inverse_laplace_transform': <function sympy.integrals.transforms.inverse_laplace_transform>,\n",
       " 'inverse_mellin_transform': <function sympy.integrals.transforms.inverse_mellin_transform>,\n",
       " 'inverse_sine_transform': <function sympy.integrals.transforms.inverse_sine_transform>,\n",
       " 'invert': <function sympy.polys.polytools.invert>,\n",
       " 'is_decreasing': <function sympy.calculus.singularities.is_decreasing>,\n",
       " 'is_increasing': <function sympy.calculus.singularities.is_increasing>,\n",
       " 'is_monotonic': <function sympy.calculus.singularities.is_monotonic>,\n",
       " 'is_nthpow_residue': <function sympy.ntheory.residue_ntheory.is_nthpow_residue>,\n",
       " 'is_primitive_root': <function sympy.ntheory.residue_ntheory.is_primitive_root>,\n",
       " 'is_quad_residue': <function sympy.ntheory.residue_ntheory.is_quad_residue>,\n",
       " 'is_strictly_decreasing': <function sympy.calculus.singularities.is_strictly_decreasing>,\n",
       " 'is_strictly_increasing': <function sympy.calculus.singularities.is_strictly_increasing>,\n",
       " 'is_zero_dimensional': <function sympy.polys.polytools.is_zero_dimensional>,\n",
       " 'isolate': <function sympy.polys.numberfields.isolate>,\n",
       " 'isprime': <function sympy.ntheory.primetest.isprime>,\n",
       " 'iterables': <module 'sympy.utilities.iterables' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\utilities\\\\iterables.py'>,\n",
       " 'itermonomials': <function sympy.polys.monomials.itermonomials>,\n",
       " 'jacobi': jacobi,\n",
       " 'jacobi_normalized': <function sympy.functions.special.polynomials.jacobi_normalized>,\n",
       " 'jacobi_poly': <function sympy.polys.orthopolys.jacobi_poly>,\n",
       " 'jacobi_symbol': <function sympy.ntheory.residue_ntheory.jacobi_symbol>,\n",
       " 'jn': jn,\n",
       " 'jn_zeros': <function sympy.functions.special.bessel.jn_zeros>,\n",
       " 'jordan_cell': <function sympy.matrices.dense.jordan_cell>,\n",
       " 'jscode': <function sympy.printing.jscode.jscode>,\n",
       " 'julia_code': <function sympy.printing.julia.julia_code>,\n",
       " 'laguerre': laguerre,\n",
       " 'laguerre_poly': <function sympy.polys.orthopolys.laguerre_poly>,\n",
       " 'lambdify': <function sympy.utilities.lambdify.lambdify>,\n",
       " 'laplace_transform': <function sympy.integrals.transforms.laplace_transform>,\n",
       " 'latex': <function sympy.printing.latex.latex>,\n",
       " 'lcm': <function sympy.polys.polytools.lcm>,\n",
       " 'lcm_list': <function sympy.polys.polytools.lcm_list>,\n",
       " 'legendre': legendre,\n",
       " 'legendre_poly': <function sympy.polys.orthopolys.legendre_poly>,\n",
       " 'legendre_symbol': <function sympy.ntheory.residue_ntheory.legendre_symbol>,\n",
       " 'lerchphi': lerchphi,\n",
       " 'lex': LexOrder(),\n",
       " 'li': li,\n",
       " 'limit': <function sympy.series.limits.limit>,\n",
       " 'limit_seq': <function sympy.series.limitseq.limit_seq>,\n",
       " 'line': <module 'sympy.geometry.line' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\geometry\\\\line.py'>,\n",
       " 'line_integrate': <function sympy.integrals.integrals.line_integrate>,\n",
       " 'linear_eq_to_matrix': <function sympy.solvers.solveset.linear_eq_to_matrix>,\n",
       " 'linsolve': <function sympy.solvers.solveset.linsolve>,\n",
       " 'list2numpy': <function sympy.matrices.dense.list2numpy>,\n",
       " 'ln': log,\n",
       " 'log': log,\n",
       " 'logcombine': <function sympy.simplify.simplify.logcombine>,\n",
       " 'loggamma': loggamma,\n",
       " 'logic': <module 'sympy.core.logic' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\logic.py'>,\n",
       " 'lowergamma': lowergamma,\n",
       " 'lucas': lucas,\n",
       " 'magic': <module 'sympy.utilities.magic' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\utilities\\\\magic.py'>,\n",
       " 'manualintegrate': <module 'sympy.integrals.manualintegrate' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\integrals\\\\manualintegrate.py'>,\n",
       " 'mathematica_code': <function sympy.printing.mathematica.mathematica_code>,\n",
       " 'mathieuc': mathieuc,\n",
       " 'mathieucprime': mathieucprime,\n",
       " 'mathieus': mathieus,\n",
       " 'mathieusprime': mathieusprime,\n",
       " 'matrices': <module 'sympy.matrices.matrices' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\matrices\\\\matrices.py'>,\n",
       " 'matrix2numpy': <function sympy.matrices.dense.matrix2numpy>,\n",
       " 'matrix_multiply_elementwise': <function sympy.matrices.dense.matrix_multiply_elementwise>,\n",
       " 'matrix_symbols': <function sympy.matrices.expressions.matexpr.matrix_symbols>,\n",
       " 'meijerg': meijerg,\n",
       " 'meijerint': <module 'sympy.integrals.meijerint' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\integrals\\\\meijerint.py'>,\n",
       " 'mellin_transform': <function sympy.integrals.transforms.mellin_transform>,\n",
       " 'memoization': <module 'sympy.utilities.memoization' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\utilities\\\\memoization.py'>,\n",
       " 'memoize_property': <function sympy.utilities.decorator.memoize_property>,\n",
       " 'minimal_polynomial': <function sympy.polys.numberfields.minimal_polynomial>,\n",
       " 'minpoly': <function sympy.polys.numberfields.minimal_polynomial>,\n",
       " 'misc': <module 'sympy.utilities.misc' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\utilities\\\\misc.py'>,\n",
       " 'mobius': mobius,\n",
       " 'mod': <module 'sympy.core.mod' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\mod.py'>,\n",
       " 'mod_inverse': <function sympy.core.numbers.mod_inverse>,\n",
       " 'monic': <function sympy.polys.polytools.monic>,\n",
       " 'mpr': <function __main__.mpr>,\n",
       " 'mu': \\mu_{0},\n",
       " 'mul': <module 'sympy.core.mul' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\mul.py'>,\n",
       " 'multidimensional': <module 'sympy.core.multidimensional' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\multidimensional.py'>,\n",
       " 'multinomial': <module 'sympy.ntheory.multinomial' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\ntheory\\\\multinomial.py'>,\n",
       " 'multinomial_coefficients': <function sympy.ntheory.multinomial.multinomial_coefficients>,\n",
       " 'multiplicity': <function sympy.ntheory.factor_.multiplicity>,\n",
       " 'n_order': <function sympy.ntheory.residue_ntheory.n_order>,\n",
       " 'nan': nan,\n",
       " 'nextprime': <function sympy.ntheory.generate.nextprime>,\n",
       " 'nfloat': <function sympy.core.function.nfloat>,\n",
       " 'nonlinsolve': <function sympy.solvers.solveset.nonlinsolve>,\n",
       " 'not_empty_in': <function sympy.calculus.util.not_empty_in>,\n",
       " 'npartitions': <function sympy.ntheory.partitions_.npartitions>,\n",
       " 'nroots': <function sympy.polys.polytools.nroots>,\n",
       " 'nsimplify': <function sympy.simplify.simplify.nsimplify>,\n",
       " 'nsolve': <function sympy.solvers.solvers.nsolve>,\n",
       " 'nth_power_roots_poly': <function sympy.polys.polytools.nth_power_roots_poly>,\n",
       " 'ntheory': <module 'sympy.ntheory' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\ntheory\\\\__init__.py'>,\n",
       " 'nthroot_mod': <function sympy.ntheory.residue_ntheory.nthroot_mod>,\n",
       " 'numbered_symbols': <function sympy.utilities.iterables.numbered_symbols>,\n",
       " 'numbers': <module 'sympy.core.numbers' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\numbers.py'>,\n",
       " 'numer': <function sympy.simplify.radsimp.numer>,\n",
       " 'octave_code': <function sympy.printing.octave.octave_code>,\n",
       " 'ode': <module 'sympy.solvers.ode' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\solvers\\\\ode.py'>,\n",
       " 'ode_order': <function sympy.solvers.deutils.ode_order>,\n",
       " 'ones': <function sympy.matrices.dense.ones>,\n",
       " 'oo': oo,\n",
       " 'operations': <module 'sympy.core.operations' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\operations.py'>,\n",
       " 'ordered': <function sympy.core.compatibility.ordered>,\n",
       " 'pager_print': <function sympy.printing.pretty.pretty.pager_print>,\n",
       " 'parabola': <module 'sympy.geometry.parabola' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\geometry\\\\parabola.py'>,\n",
       " 'parallel_poly_from_expr': <function sympy.polys.polytools.parallel_poly_from_expr>,\n",
       " 'parsing': <module 'sympy.parsing' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\parsing\\\\__init__.py'>,\n",
       " 'partitions_': <module 'sympy.ntheory.partitions_' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\ntheory\\\\partitions_.py'>,\n",
       " 'pde': <module 'sympy.solvers.pde' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\solvers\\\\pde.py'>,\n",
       " 'pde_separate': <function sympy.solvers.pde.pde_separate>,\n",
       " 'pde_separate_add': <function sympy.solvers.pde.pde_separate_add>,\n",
       " 'pde_separate_mul': <function sympy.solvers.pde.pde_separate_mul>,\n",
       " 'pdiv': <function sympy.polys.polytools.pdiv>,\n",
       " 'pdsolve': <function sympy.solvers.pde.pdsolve>,\n",
       " 'perfect_power': <function sympy.ntheory.factor_.perfect_power>,\n",
       " 'periodic_argument': periodic_argument,\n",
       " 'periodicity': <function sympy.calculus.util.periodicity>,\n",
       " 'permutedims': <function sympy.tensor.array.arrayop.permutedims>,\n",
       " 'pexquo': <function sympy.polys.polytools.pexquo>,\n",
       " 'physics': <module 'sympy.physics' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\physics\\\\__init__.py'>,\n",
       " 'pi': pi,\n",
       " 'piecewise_fold': <function sympy.functions.elementary.piecewise.piecewise_fold>,\n",
       " 'plane': <module 'sympy.geometry.plane' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\geometry\\\\plane.py'>,\n",
       " 'plot': <function sympy.plotting.plot.plot>,\n",
       " 'plot_backends': {'default': sympy.plotting.plot.DefaultBackend,\n",
       "  'matplotlib': sympy.plotting.plot.MatplotlibBackend,\n",
       "  'text': sympy.plotting.plot.TextBackend},\n",
       " 'plot_implicit': <function sympy.plotting.plot_implicit.plot_implicit>,\n",
       " 'plotting': <module 'sympy.plotting' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\plotting\\\\__init__.py'>,\n",
       " 'point': <module 'sympy.geometry.point' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\geometry\\\\point.py'>,\n",
       " 'polar_lift': polar_lift,\n",
       " 'polarify': <function sympy.functions.elementary.complexes.polarify>,\n",
       " 'pollard_pm1': <function sympy.ntheory.factor_.pollard_pm1>,\n",
       " 'pollard_rho': <function sympy.ntheory.factor_.pollard_rho>,\n",
       " 'poly': <function sympy.polys.polytools.poly>,\n",
       " 'poly_from_expr': <function sympy.polys.polytools.poly_from_expr>,\n",
       " 'polygamma': polygamma,\n",
       " 'polygon': <module 'sympy.geometry.polygon' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\geometry\\\\polygon.py'>,\n",
       " 'polylog': polylog,\n",
       " 'polys': <module 'sympy.polys' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\polys\\\\__init__.py'>,\n",
       " 'polysys': <module 'sympy.solvers.polysys' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\solvers\\\\polysys.py'>,\n",
       " 'posify': <function sympy.simplify.simplify.posify>,\n",
       " 'postfixes': <function sympy.utilities.iterables.postfixes>,\n",
       " 'postorder_traversal': <function sympy.utilities.iterables.postorder_traversal>,\n",
       " 'powdenest': <function sympy.simplify.powsimp.powdenest>,\n",
       " 'power': <module 'sympy.core.power' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\power.py'>,\n",
       " 'powsimp': <function sympy.simplify.powsimp.powsimp>,\n",
       " 'pprint': <function sympy.printing.pretty.pretty.pretty_print>,\n",
       " 'pprint_try_use_unicode': <function sympy.printing.pretty.pretty_symbology.pretty_try_use_unicode>,\n",
       " 'pprint_use_unicode': <function sympy.printing.pretty.pretty_symbology.pretty_use_unicode>,\n",
       " 'pquo': <function sympy.polys.polytools.pquo>,\n",
       " 'prefixes': <function sympy.utilities.iterables.prefixes>,\n",
       " 'prem': <function sympy.polys.polytools.prem>,\n",
       " 'preorder_traversal': sympy.core.basic.preorder_traversal,\n",
       " 'pretty': <function sympy.printing.pretty.pretty.pretty>,\n",
       " 'pretty_print': <function sympy.printing.pretty.pretty.pretty_print>,\n",
       " 'preview': <function sympy.printing.preview.preview>,\n",
       " 'prevprime': <function sympy.ntheory.generate.prevprime>,\n",
       " 'prime': <function sympy.ntheory.generate.prime>,\n",
       " 'primefactors': <function sympy.ntheory.factor_.primefactors>,\n",
       " 'primenu': primenu,\n",
       " 'primeomega': primeomega,\n",
       " 'primepi': <function sympy.ntheory.generate.primepi>,\n",
       " 'primerange': <function sympy.ntheory.generate.primerange>,\n",
       " 'primetest': <module 'sympy.ntheory.primetest' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\ntheory\\\\primetest.py'>,\n",
       " 'primitive': <function sympy.polys.polytools.primitive>,\n",
       " 'primitive_element': <function sympy.polys.numberfields.primitive_element>,\n",
       " 'primitive_root': <function sympy.ntheory.residue_ntheory.primitive_root>,\n",
       " 'primorial': <function sympy.ntheory.generate.primorial>,\n",
       " 'principal_branch': principal_branch,\n",
       " 'print_gtk': <function sympy.printing.gtk.print_gtk>,\n",
       " 'print_python': <function sympy.printing.python.print_python>,\n",
       " 'print_tree': <function sympy.printing.tree.print_tree>,\n",
       " 'printing': <module 'sympy.printing' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\printing\\\\__init__.py'>,\n",
       " 'prod': <function sympy.core.mul.prod>,\n",
       " 'product': <function sympy.concrete.products.product>,\n",
       " 'products': <module 'sympy.concrete.products' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\concrete\\\\products.py'>,\n",
       " 'public': <function sympy.utilities.decorator.public>,\n",
       " 'python': <function sympy.printing.python.python>,\n",
       " 'quadratic_residues': <function sympy.ntheory.residue_ntheory.quadratic_residues>,\n",
       " 'quit': <IPython.core.autocall.ZMQExitAutocall at 0x3434170>,\n",
       " 'quo': <function sympy.polys.polytools.quo>,\n",
       " 'rad': <function sympy.geometry.polygon.rad>,\n",
       " 'radsimp': <function sympy.simplify.radsimp.radsimp>,\n",
       " 'randMatrix': <function sympy.matrices.dense.randMatrix>,\n",
       " 'random_poly': <function sympy.polys.specialpolys.random_poly>,\n",
       " 'randprime': <function sympy.ntheory.generate.randprime>,\n",
       " 'rational_interpolate': <function sympy.polys.polyfuncs.rational_interpolate>,\n",
       " 'ratsimp': <function sympy.simplify.ratsimp.ratsimp>,\n",
       " 'ratsimpmodprime': <function sympy.simplify.ratsimp.ratsimpmodprime>,\n",
       " 'rcode': <function sympy.printing.rcode.rcode>,\n",
       " 'rcollect': <function sympy.simplify.radsimp.rcollect>,\n",
       " 're': re,\n",
       " 'real_root': <function sympy.functions.elementary.miscellaneous.real_root>,\n",
       " 'real_roots': <function sympy.polys.polytools.real_roots>,\n",
       " 'recurr': <module 'sympy.solvers.recurr' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\solvers\\\\recurr.py'>,\n",
       " 'reduce_abs_inequalities': <function sympy.solvers.inequalities.reduce_abs_inequalities>,\n",
       " 'reduce_abs_inequality': <function sympy.solvers.inequalities.reduce_abs_inequality>,\n",
       " 'reduce_inequalities': <function sympy.solvers.inequalities.reduce_inequalities>,\n",
       " 'reduced': <function sympy.polys.polytools.reduced>,\n",
       " 'reduced_totient': reduced_totient,\n",
       " 'refine': <function sympy.assumptions.refine.refine>,\n",
       " 'refine_root': <function sympy.polys.polytools.refine_root>,\n",
       " 'register_handler': <function sympy.assumptions.ask.register_handler>,\n",
       " 'relational': <module 'sympy.core.relational' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\relational.py'>,\n",
       " 'release': <module 'sympy.release' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\release.py'>,\n",
       " 'rem': <function sympy.polys.polytools.rem>,\n",
       " 'remove_handler': <function sympy.assumptions.ask.remove_handler>,\n",
       " 'reshape': <function sympy.utilities.iterables.reshape>,\n",
       " 'residue': <function sympy.series.residues.residue>,\n",
       " 'residue_ntheory': <module 'sympy.ntheory.residue_ntheory' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\ntheory\\\\residue_ntheory.py'>,\n",
       " 'resultant': <function sympy.polys.polytools.resultant>,\n",
       " 'rf': RisingFactorial,\n",
       " 'ring': <function sympy.polys.rings.ring>,\n",
       " 'root': <function sympy.functions.elementary.miscellaneous.root>,\n",
       " 'rootof': <function sympy.polys.rootoftools.rootof>,\n",
       " 'roots': <function sympy.polys.polyroots.roots>,\n",
       " 'rot_axis1': <function sympy.matrices.dense.rot_axis1>,\n",
       " 'rot_axis2': <function sympy.matrices.dense.rot_axis2>,\n",
       " 'rot_axis3': <function sympy.matrices.dense.rot_axis3>,\n",
       " 'rsolve': <function sympy.solvers.recurr.rsolve>,\n",
       " 'rsolve_hyper': <function sympy.solvers.recurr.rsolve_hyper>,\n",
       " 'rsolve_poly': <function sympy.solvers.recurr.rsolve_poly>,\n",
       " 'rsolve_ratio': <function sympy.solvers.recurr.rsolve_ratio>,\n",
       " 'rules': <module 'sympy.core.rules' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\rules.py'>,\n",
       " 'runtests': <module 'sympy.utilities.runtests' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\utilities\\\\runtests.py'>,\n",
       " 'rust_code': <function sympy.printing.rust.rust_code>,\n",
       " 'satisfiable': <function sympy.logic.inference.satisfiable>,\n",
       " 'sec': sec,\n",
       " 'sech': sech,\n",
       " 'separatevars': <function sympy.simplify.simplify.separatevars>,\n",
       " 'sequence': <function sympy.series.sequences.sequence>,\n",
       " 'series': <function sympy.series.series.series>,\n",
       " 'seterr': <function sympy.core.numbers.seterr>,\n",
       " 'sets': <module 'sympy.sets.sets' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\sets\\\\sets.py'>,\n",
       " 'sfield': <function sympy.polys.fields.sfield>,\n",
       " 'sieve': <Sieve with 6 primes sieved: 2, 3, 5, ... 11, 13>,\n",
       " 'sift': <function sympy.utilities.iterables.sift>,\n",
       " 'sign': sign,\n",
       " 'signsimp': <function sympy.simplify.simplify.signsimp>,\n",
       " 'simplify': <function sympy.simplify.simplify.simplify>,\n",
       " 'simplify_logic': <function sympy.logic.boolalg.simplify_logic>,\n",
       " 'sin': sin,\n",
       " 'sinc': sinc,\n",
       " 'sine_transform': <function sympy.integrals.transforms.sine_transform>,\n",
       " 'singleton': <module 'sympy.core.singleton' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\singleton.py'>,\n",
       " 'singularities': <function sympy.calculus.singularities.singularities>,\n",
       " 'singularityfunctions': <module 'sympy.integrals.singularityfunctions' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\integrals\\\\singularityfunctions.py'>,\n",
       " 'singularityintegrate': <function sympy.integrals.singularityfunctions.singularityintegrate>,\n",
       " 'sinh': sinh,\n",
       " 'solve': <function sympy.solvers.solvers.solve>,\n",
       " 'solve_linear': <function sympy.solvers.solvers.solve_linear>,\n",
       " 'solve_linear_system': <function sympy.solvers.solvers.solve_linear_system>,\n",
       " 'solve_linear_system_LU': <function sympy.solvers.solvers.solve_linear_system_LU>,\n",
       " 'solve_poly_inequality': <function sympy.solvers.inequalities.solve_poly_inequality>,\n",
       " 'solve_poly_system': <function sympy.solvers.polysys.solve_poly_system>,\n",
       " 'solve_rational_inequalities': <function sympy.solvers.inequalities.solve_rational_inequalities>,\n",
       " 'solve_triangulated': <function sympy.solvers.polysys.solve_triangulated>,\n",
       " 'solve_undetermined_coeffs': <function sympy.solvers.solvers.solve_undetermined_coeffs>,\n",
       " 'solve_univariate_inequality': <function sympy.solvers.inequalities.solve_univariate_inequality>,\n",
       " 'solvers': <module 'sympy.solvers.solvers' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\solvers\\\\solvers.py'>,\n",
       " 'solveset': <function sympy.solvers.solveset.solveset>,\n",
       " 'source': <function sympy.utilities.source.source>,\n",
       " 'sparse': <module 'sympy.matrices.sparse' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\matrices\\\\sparse.py'>,\n",
       " 'special': <module 'sympy.functions.special' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\functions\\\\special\\\\__init__.py'>,\n",
       " 'sqf': <function sympy.polys.polytools.sqf>,\n",
       " 'sqf_list': <function sympy.polys.polytools.sqf_list>,\n",
       " 'sqf_norm': <function sympy.polys.polytools.sqf_norm>,\n",
       " 'sqf_part': <function sympy.polys.polytools.sqf_part>,\n",
       " 'sqrt': <function sympy.functions.elementary.miscellaneous.sqrt>,\n",
       " 'sqrt_mod': <function sympy.ntheory.residue_ntheory.sqrt_mod>,\n",
       " 'sqrt_mod_iter': <function sympy.ntheory.residue_ntheory.sqrt_mod_iter>,\n",
       " 'sqrtdenest': <function sympy.simplify.sqrtdenest.sqrtdenest>,\n",
       " 'srepr': <function sympy.printing.repr.srepr>,\n",
       " 'sring': <function sympy.polys.rings.sring>,\n",
       " 'sstr': <function sympy.printing.str.sstr>,\n",
       " 'sstrrepr': <function sympy.printing.str.sstrrepr>,\n",
       " 'stieltjes': stieltjes,\n",
       " 'strategies': <module 'sympy.strategies' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\strategies\\\\__init__.py'>,\n",
       " 'sturm': <function sympy.polys.polytools.sturm>,\n",
       " 'subfactorial': subfactorial,\n",
       " 'subresultants': <function sympy.polys.polytools.subresultants>,\n",
       " 'subsets': <function sympy.utilities.iterables.subsets>,\n",
       " 'substitution': <function sympy.solvers.solveset.substitution>,\n",
       " 'summation': <function sympy.concrete.summations.summation>,\n",
       " 'summations': <module 'sympy.concrete.summations' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\concrete\\\\summations.py'>,\n",
       " 'swinnerton_dyer_poly': <function sympy.polys.specialpolys.swinnerton_dyer_poly>,\n",
       " 'symarray': <function sympy.matrices.dense.symarray>,\n",
       " 'symbol': <module 'sympy.core.symbol' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\core\\\\symbol.py'>,\n",
       " 'symbols': <function sympy.core.symbol.symbols>,\n",
       " 'symmetric_poly': <function sympy.polys.specialpolys.symmetric_poly>,\n",
       " 'symmetrize': <function sympy.polys.polyfuncs.symmetrize>,\n",
       " 'sympify': <function sympy.core.sympify.sympify>,\n",
       " 'take': <function sympy.utilities.iterables.take>,\n",
       " 'tan': tan,\n",
       " 'tanh': tanh,\n",
       " 'tensor': <module 'sympy.tensor' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\tensor\\\\__init__.py'>,\n",
       " 'tensorcontraction': <function sympy.tensor.array.arrayop.tensorcontraction>,\n",
       " 'tensorproduct': <function sympy.tensor.array.arrayop.tensorproduct>,\n",
       " 'terms_gcd': <function sympy.polys.polytools.terms_gcd>,\n",
       " 'test': <function sympy.utilities.runtests.test>,\n",
       " 'textplot': <function sympy.plotting.textplot.textplot>,\n",
       " 'threaded': <function sympy.utilities.decorator.threaded>,\n",
       " 'timed': <function sympy.utilities.timeutils.timed>,\n",
       " 'timeutils': <module 'sympy.utilities.timeutils' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\utilities\\\\timeutils.py'>,\n",
       " 'to_cnf': <function sympy.logic.boolalg.to_cnf>,\n",
       " 'to_dnf': <function sympy.logic.boolalg.to_dnf>,\n",
       " 'to_nnf': <function sympy.logic.boolalg.to_nnf>,\n",
       " 'to_number_field': <function sympy.polys.numberfields.to_number_field>,\n",
       " 'together': <function sympy.polys.rationaltools.together>,\n",
       " 'topological_sort': <function sympy.utilities.iterables.topological_sort>,\n",
       " 'totient': totient,\n",
       " 'trace': <function sympy.matrices.expressions.trace.trace>,\n",
       " 'trailing': <function sympy.ntheory.factor_.trailing>,\n",
       " 'transforms': <module 'sympy.integrals.transforms' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\integrals\\\\transforms.py'>,\n",
       " 'transpose': transpose,\n",
       " 'traversaltools': <module 'sympy.simplify.traversaltools' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\simplify\\\\traversaltools.py'>,\n",
       " 'trigamma': <function sympy.functions.special.gamma_functions.trigamma>,\n",
       " 'trigonometry': <module 'sympy.integrals.trigonometry' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\integrals\\\\trigonometry.py'>,\n",
       " 'trigsimp': <function sympy.simplify.trigsimp.trigsimp>,\n",
       " 'true': True,\n",
       " 'trunc': <function sympy.polys.polytools.trunc>,\n",
       " 'unbranched_argument': <function sympy.functions.elementary.complexes.unbranched_argument>,\n",
       " 'unflatten': <function sympy.utilities.iterables.unflatten>,\n",
       " 'unpolarify': <function sympy.functions.elementary.complexes.unpolarify>,\n",
       " 'uppergamma': uppergamma,\n",
       " 'use': <function sympy.simplify.traversaltools.use>,\n",
       " 'util': <module 'sympy.geometry.util' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\geometry\\\\util.py'>,\n",
       " 'utilities': <module 'sympy.utilities' from 'd:\\\\python36\\\\lib\\\\site-packages\\\\sympy\\\\utilities\\\\__init__.py'>,\n",
       " 'var': <function sympy.core.symbol.var>,\n",
       " 'variations': <function sympy.utilities.iterables.variations>,\n",
       " 'vectorize': sympy.core.multidimensional.vectorize,\n",
       " 'vfield': <function sympy.polys.fields.vfield>,\n",
       " 'viete': <function sympy.polys.polyfuncs.viete>,\n",
       " 'vring': <function sympy.polys.rings.vring>,\n",
       " 'wronskian': <function sympy.matrices.dense.wronskian>,\n",
       " 'x': x,\n",
       " 'xfield': <function sympy.polys.fields.xfield>,\n",
       " 'xring': <function sympy.polys.rings.xring>,\n",
       " 'xthreaded': <function sympy.utilities.decorator.xthreaded>,\n",
       " 'yn': yn,\n",
       " 'zeros': <function sympy.matrices.dense.zeros>,\n",
       " 'zeta': zeta,\n",
       " 'zoo': zoo}"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "locals()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Chess Judge 伪代码\n",
    "```\n",
    "if not first and ismine(chess):\n",
    "    set_first(chess)\n",
    "elif is_chess(chess):\n",
    "    if chess==first:\n",
    "        del_first()\n",
    "    elif ismine(chess):\n",
    "        set_first(chess)\n",
    "    else:\n",
    "        if is_valid(chess):\n",
    "            move(chess)\n",
    "        else:\n",
    "            del_first()\n",
    "else:\n",
    "    if is_valid(chess):\n",
    "        move(chess)\n",
    "    else:\n",
    "        del_first()      \n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
